diff --git a/crates/title_bar/src/collab.rs b/crates/title_bar/src/collab.rs index 250816f6d8bc6d54d6848e7fdc5f1bfa52dab16c..3eaa5fcc6b8706956afd09b4043f706691a98f8b 100644 --- a/crates/title_bar/src/collab.rs +++ b/crates/title_bar/src/collab.rs @@ -350,6 +350,42 @@ impl TitleBar { .into_any_element(), ); + children.push( + IconButton::new( + "mute-sound", + if is_deafened { + ui::IconName::AudioOff + } else { + ui::IconName::AudioOn + }, + ) + .style(ButtonStyle::Subtle) + .selected_style(ButtonStyle::Tinted(TintColor::Error)) + .icon_size(IconSize::Small) + .toggle_state(is_deafened) + .tooltip(move |window, cx| { + if is_deafened { + let label = "Unmute Audio"; + + if !muted_by_user { + Tooltip::with_meta(label, None, "Microphone will be unmuted", window, cx) + } else { + Tooltip::simple(label, cx) + } + } else { + let label = "Mute Audio"; + + if !muted_by_user { + Tooltip::with_meta(label, None, "Microphone will be muted", window, cx) + } else { + Tooltip::simple(label, cx) + } + } + }) + .on_click(move |_, _, cx| toggle_deafen(&Default::default(), cx)) + .into_any_element(), + ); + if can_use_microphone { children.push( IconButton::new( @@ -387,48 +423,6 @@ impl TitleBar { .into_any_element(), ); - children.push( - IconButton::new( - "mute-sound", - if is_deafened { - ui::IconName::AudioOff - } else { - ui::IconName::AudioOn - }, - ) - .style(ButtonStyle::Subtle) - .selected_style(ButtonStyle::Tinted(TintColor::Error)) - .icon_size(IconSize::Small) - .toggle_state(is_deafened) - .tooltip(move |window, cx| { - if is_deafened { - let label = "Unmute Audio"; - - if !muted_by_user { - Tooltip::with_meta( - label, - None, - "Microphone will be unmuted", - window, - cx, - ) - } else { - Tooltip::simple(label, cx) - } - } else { - let label = "Mute Audio"; - - if !muted_by_user { - Tooltip::with_meta(label, None, "Microphone will be muted", window, cx) - } else { - Tooltip::simple(label, cx) - } - } - }) - .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)