Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
title_bar: Adjust tooltip for mute/deafen buttons (#21931)
Piotr Osiewicz111e844753ef
diff --git a/crates/title_bar/src/collab.rs b/crates/title_bar/src/collab.rsindex 7d977bb458a..35cdeda9e8b 100644--- a/crates/title_bar/src/collab.rs+++ b/crates/title_bar/src/collab.rs@@ -362,14 +362,20 @@ impl TitleBar {},).tooltip(move |cx| {- Tooltip::text(- if is_muted {- "Unmute microphone"+ if is_muted {+ if is_deafened {+ Tooltip::with_meta(+ "Unmute microphone",+ None,+ "Audio will be unmuted",+ cx,+ )} else {- "Mute microphone"- },- cx,- )+ Tooltip::text("Unmute microphone", cx)+ }+ } else {+ Tooltip::text("Mute microphone", cx)+ }}).style(ButtonStyle::Subtle).icon_size(IconSize::Small)@@ -395,7 +401,12 @@ impl TitleBar {.icon_size(IconSize::Small).selected(is_deafened).tooltip(move |cx| {- Tooltip::with_meta("Deafen Audio", None, "Mic will be muted", cx)+ let (label, details) = if is_deafened {+ ("Unmute Audio", "Mic will be unmuted")+ } else {+ ("Mute Audio", "Mic will be muted")+ };+ Tooltip::with_meta(label, None, details, cx)}).on_click(move |_, cx| toggle_deafen(&Default::default(), cx)).into_any_element(),