From c75aca25b626fb3168babb23240d4cc7c4495cdc Mon Sep 17 00:00:00 2001 From: Julia Date: Mon, 20 Feb 2023 17:06:16 -0500 Subject: [PATCH] Remove left side collaborator list Co-Authored-By: Max Brunsfeld --- crates/collab_ui/src/collab_titlebar_item.rs | 72 -------------------- crates/theme/src/theme.rs | 2 - styles/src/styleTree/workspace.ts | 21 ------ 3 files changed, 95 deletions(-) diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index 9893a047b04b022a982ea006020cffe7d3de331b..dc449e9d9663e7c29a77e6e2456a06e389da8f14 100644 --- a/crates/collab_ui/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -91,7 +91,6 @@ impl View for CollabTitlebarItem { ); if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() { - left_container.add_child(self.render_toggle_collaborator_list_button(&theme, cx)); left_container.add_child(self.render_current_user(&workspace, &theme, &user, cx)); left_container.add_children(self.render_collaborators(&workspace, &theme, room, cx)); left_container.add_child(self.render_toggle_contacts_button(&theme, cx)); @@ -218,77 +217,6 @@ impl CollabTitlebarItem { } } - fn render_toggle_collaborator_list_button( - &self, - theme: &Theme, - cx: &mut RenderContext, - ) -> ElementBox { - let titlebar = &theme.workspace.titlebar; - - Stack::new() - .with_child( - MouseEventHandler::::new(0, cx, |state, cx| { - let collaborator_count_style = titlebar.collaborator_count.clone(); - let style = titlebar - .toggle_collaborators_button - .style_for(state, self.collaborator_list_popover.is_some()); - - let active_call = ActiveCall::global(cx); - let collaborator_count = active_call - .read(cx) - .room() - .map_or(0, |room| room.read(cx).remote_participants().len()) - + 1; - - Flex::row() - .with_child( - Svg::new("icons/user_group_12.svg") - .with_color(style.color) - .constrained() - .with_width(style.width) - .aligned() - .contained() - .with_style(style.container) - .boxed(), - ) - .with_child( - Label::new( - format!("{collaborator_count}"), - collaborator_count_style.text, - ) - .contained() - .with_style(collaborator_count_style.container) - .aligned() - .boxed(), - ) - .contained() - .with_style(style.container) - .boxed() - }) - .with_cursor_style(CursorStyle::PointingHand) - .on_click(MouseButton::Left, move |_, cx| { - cx.dispatch_action(ToggleCollaboratorList); - }) - .aligned() - .boxed(), - ) - .with_children(self.collaborator_list_popover.as_ref().map(|popover| { - Overlay::new( - ChildView::new(popover, cx) - .contained() - .with_margin_top(titlebar.height) - .with_margin_left(titlebar.toggle_collaborators_button.default.width) - .with_margin_right(-titlebar.toggle_collaborators_button.default.width) - .boxed(), - ) - .with_fit_mode(OverlayFitMode::SwitchAnchor) - .with_anchor_corner(AnchorCorner::BottomLeft) - .with_z_index(999) - .boxed() - })) - .boxed() - } - pub fn toggle_collaborator_list_popover( &mut self, _: &ToggleCollaboratorList, diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index b4d3883b4a0c2ce68c7679714ffb478a3e2cbe6c..904e6c2bd3222ee252a61ea7bdec5ffefa6f75f0 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -84,8 +84,6 @@ pub struct Titlebar { pub outdated_warning: ContainedText, pub share_button: Interactive, pub call_control: Interactive, - pub toggle_collaborators_button: Interactive, - pub collaborator_count: ContainedText, pub toggle_contacts_button: Interactive, pub toggle_contacts_badge: ContainerStyle, } diff --git a/styles/src/styleTree/workspace.ts b/styles/src/styleTree/workspace.ts index 072fdab673eb57d5b3c59a54bd870c67d0f63172..f0a11db1f9d2e2ac3af0609fe83ddf3f6564fa72 100644 --- a/styles/src/styleTree/workspace.ts +++ b/styles/src/styleTree/workspace.ts @@ -157,27 +157,6 @@ export default function workspace(colorScheme: ColorScheme) { color: foreground(layer, "variant", "hovered"), }, }, - toggleCollaboratorsButton: { - margin: { left: 6 }, - cornerRadius: 6, - color: foreground(layer, "variant"), - width: 12, - active: { - background: background(layer, "variant", "active"), - color: foreground(layer, "variant", "active"), - }, - hover: { - background: background(layer, "variant", "hovered"), - color: foreground(layer, "variant", "hovered"), - }, - }, - collaboratorCount: { - ...text(layer, "mono", { size: "sm" }), - margin: { - left: 4, - right: 6, - }, - }, toggleContactsButton: { margin: { left: 6 }, cornerRadius: 6,