From 111e844753ef5021a084f6adeb70c1bf53fcd1c9 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:09:52 +0100 Subject: [PATCH] title_bar: Adjust tooltip for mute/deafen buttons (#21931) Closes #21929 Release Notes: - N/A --- crates/title_bar/src/collab.rs | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/crates/title_bar/src/collab.rs b/crates/title_bar/src/collab.rs index 7d977bb458addfddffc76de144cfca0aded00e92..35cdeda9e8be05d1315710bb5eb524c075df5b90 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(),