Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add button
Piotr Osiewicz62786cd508c6
diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rsindex 17f4f06ff9d..81e27361640 100644--- a/crates/collab_ui/src/collab_titlebar_item.rs+++ b/crates/collab_ui/src/collab_titlebar_item.rs@@ -1,6 +1,6 @@use crate::{contact_notification::ContactNotification, contacts_popover, face_pile::FacePile,- toggle_deafen, toggle_mute, toggle_screen_sharing, ToggleDeafen, ToggleMute,+ toggle_deafen, toggle_mute, toggle_screen_sharing, LeaveCall, ToggleDeafen, ToggleMute,ToggleScreenSharing,};use call::{ActiveCall, ParticipantLocation, Room};@@ -85,7 +85,7 @@ impl View for CollabTitlebarItem {{right_container.add_children(self.render_in_call_share_unshare_button(&workspace, &theme, cx));-+ right_container.add_child(self.render_leave_call(&theme, cx));left_container.add_child(self.render_current_user(&workspace, &theme, &user, peer_id, cx));left_container.add_children(self.render_collaborators(&workspace, &theme, &room, cx));@@ -544,6 +544,43 @@ impl CollabTitlebarItem {.aligned().into_any()}+ fn render_leave_call(&self, theme: &Theme, cx: &mut ViewContext<Self>) -> AnyElement<Self> {+ let icon = "icons/radix/exit.svg";+ let tooltip = "Leave call";++ let titlebar = &theme.workspace.titlebar;+ MouseEventHandler::<LeaveCall, Self>::new(0, cx, |state, _| {+ let style = titlebar+ .toggle_speakers_button+ .in_state(false)+ .style_for(state);+ Svg::new(icon)+ .with_color(style.color)+ .constrained()+ .with_width(style.icon_width)+ .aligned()+ .constrained()+ .with_width(style.button_width)+ .with_height(style.button_width)+ .contained()+ .with_style(style.container)+ })+ .with_cursor_style(CursorStyle::PointingHand)+ .on_click(MouseButton::Left, move |_, _, cx| {+ ActiveCall::global(cx)+ .update(cx, |call, cx| call.hang_up(cx))+ .detach_and_log_err(cx);+ })+ .with_tooltip::<LeaveCall>(+ 0,+ tooltip.into(),+ Some(Box::new(LeaveCall)),+ theme.tooltip.clone(),+ cx,+ )+ .aligned()+ .into_any()+ }fn render_in_call_share_unshare_button(&self,workspace: &ViewHandle<Workspace>,diff --git a/crates/collab_ui/src/collab_ui.rs b/crates/collab_ui/src/collab_ui.rsindex 38a39762f4c..a809b9c7e6d 100644--- a/crates/collab_ui/src/collab_ui.rs+++ b/crates/collab_ui/src/collab_ui.rs@@ -22,6 +22,7 @@ actions!(ToggleScreenSharing,ToggleMute,ToggleDeafen,+ LeaveCall,ShareMicrophone]);