Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

collab_ui: Show the chat panel icon when the chat panel is active (#22593)

Marshall Bowersa53be7b4bee0
diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rs
index 6ac6f007ed4..f8cae3b1cd6 100644
--- a/crates/collab_ui/src/chat_panel.rs
+++ b/crates/collab_ui/src/chat_panel.rs
@@ -1135,15 +1135,20 @@ impl Panel for ChatPanel {
}
fn icon(&self, cx: &WindowContext) -> Option<ui::IconName> {
- match ChatPanelSettings::get_global(cx).button {
- ChatPanelButton::Never => None,
- ChatPanelButton::Always => Some(ui::IconName::MessageBubbles),
- ChatPanelButton::WhenInCall => ActiveCall::global(cx)
- .read(cx)
- .room()
- .filter(|room| room.read(cx).contains_guests())
- .map(|_| ui::IconName::MessageBubbles),
- }
+ let show_icon = match ChatPanelSettings::get_global(cx).button {
+ ChatPanelButton::Never => false,
+ ChatPanelButton::Always => true,
+ ChatPanelButton::WhenInCall => {
+ let is_in_call = ActiveCall::global(cx)
+ .read(cx)
+ .room()
+ .map_or(false, |room| room.read(cx).contains_guests());
+
+ self.active || is_in_call
+ }
+ };
+
+ show_icon.then(|| ui::IconName::MessageBubbles)
}
fn icon_tooltip(&self, _cx: &WindowContext) -> Option<&'static str> {