Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
title_bar: Fix the order of the collab buttons (#25775)
Devzethc47305dd7b03
diff --git a/crates/title_bar/src/collab.rs b/crates/title_bar/src/collab.rsindex 3eaa5fcc6b8..24ca5ee8a25 100644--- a/crates/title_bar/src/collab.rs+++ b/crates/title_bar/src/collab.rs@@ -350,6 +350,44 @@ impl TitleBar {.into_any_element(),);+ if can_use_microphone {+ children.push(+ IconButton::new(+ "mute-microphone",+ if is_muted {+ ui::IconName::MicMute+ } else {+ ui::IconName::Mic+ },+ )+ .tooltip(move |window, cx| {+ if is_muted {+ if is_deafened {+ Tooltip::with_meta(+ "Unmute Microphone",+ None,+ "Audio will be unmuted",+ window,+ cx,+ )+ } else {+ Tooltip::simple("Unmute Microphone", cx)+ }+ } else {+ Tooltip::simple("Mute Microphone", cx)+ }+ })+ .style(ButtonStyle::Subtle)+ .icon_size(IconSize::Small)+ .toggle_state(is_muted)+ .selected_style(ButtonStyle::Tinted(TintColor::Error))+ .on_click(move |_, _window, cx| {+ toggle_mute(&Default::default(), cx);+ })+ .into_any_element(),+ );+ }+children.push(IconButton::new("mute-sound",@@ -386,61 +424,23 @@ impl TitleBar {.into_any_element(),);- if can_use_microphone {+ if can_use_microphone && screen_sharing_supported {children.push(- IconButton::new(- "mute-microphone",- if is_muted {- ui::IconName::MicMute+ 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 {- ui::IconName::Mic- },- )- .tooltip(move |window, cx| {- if is_muted {- if is_deafened {- Tooltip::with_meta(- "Unmute Microphone",- None,- "Audio will be unmuted",- window,- cx,- )- } else {- Tooltip::simple("Unmute Microphone", cx)- }- } else {- Tooltip::simple("Mute Microphone", cx)- }- })- .style(ButtonStyle::Subtle)- .icon_size(IconSize::Small)- .toggle_state(is_muted)- .selected_style(ButtonStyle::Tinted(TintColor::Error))- .on_click(move |_, _window, cx| {- toggle_mute(&Default::default(), cx);- })- .into_any_element(),+ "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());