Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
title_bar: Hide screen share when user doesn't have the permission (#25192)
Beniamin Zagan2d6592dcaaa8
diff --git a/crates/title_bar/src/collab.rs b/crates/title_bar/src/collab.rsindex 536190cc5f1..250816f6d8b 100644--- a/crates/title_bar/src/collab.rs+++ b/crates/title_bar/src/collab.rs@@ -428,25 +428,25 @@ impl TitleBar {.on_click(move |_, _, cx| toggle_deafen(&Default::default(), cx)).into_any_element(),);- }- if screen_sharing_supported {- children.push(- IconButton::new("screen-share", ui::IconName::Screen)- .style(ButtonStyle::Subtle)- .icon_size(IconSize::Small)- .toggle_state(is_screen_sharing)- .selected_style(ButtonStyle::Tinted(TintColor::Accent))- .tooltip(Tooltip::text(if is_screen_sharing {- "Stop Sharing Screen"- } else {- "Share Screen"- }))- .on_click(move |_, window, cx| {- toggle_screen_sharing(&Default::default(), window, cx)- })- .into_any_element(),- );+ if screen_sharing_supported {+ children.push(+ IconButton::new("screen-share", ui::IconName::Screen)+ .style(ButtonStyle::Subtle)+ .icon_size(IconSize::Small)+ .toggle_state(is_screen_sharing)+ .selected_style(ButtonStyle::Tinted(TintColor::Accent))+ .tooltip(Tooltip::text(if is_screen_sharing {+ "Stop Sharing Screen"+ } else {+ "Share Screen"+ }))+ .on_click(move |_, window, cx| {+ toggle_screen_sharing(&Default::default(), window, cx)+ })+ .into_any_element(),+ );+ }}children.push(div().pr_2().into_any_element());