From 6e1ba645f3e73fe0e867d27b2152d853ef74a2ab Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 20 Dec 2023 14:17:15 +0100 Subject: [PATCH] Show button as selected if screen sharing is on --- crates/collab_ui2/src/collab_titlebar_item.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/collab_ui2/src/collab_titlebar_item.rs b/crates/collab_ui2/src/collab_titlebar_item.rs index 9359ff41d8..ae66485919 100644 --- a/crates/collab_ui2/src/collab_titlebar_item.rs +++ b/crates/collab_ui2/src/collab_titlebar_item.rs @@ -176,6 +176,7 @@ impl Render for CollabTitlebarItem { let is_shared = self.project.read(cx).is_shared(); let is_muted = room.is_muted(cx); let is_deafened = room.is_deafened().unwrap_or(false); + let is_screen_sharing = room.is_screen_sharing(); this.child( Button::new( @@ -225,7 +226,7 @@ impl Render for CollabTitlebarItem { }, ) .style(ButtonStyle::Subtle) - .selected(is_deafened.clone()) + .selected(is_deafened) .tooltip(move |cx| { Tooltip::with_meta("Deafen Audio", None, "Mic will be muted", cx) }) @@ -234,6 +235,7 @@ impl Render for CollabTitlebarItem { .child( IconButton::new("screen-share", ui::Icon::Screen) .style(ButtonStyle::Subtle) + .selected(is_screen_sharing) .on_click(move |_, cx| { crate::toggle_screen_sharing(&Default::default(), cx) }),