Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Show sign in button directly in titlebar when not signed in
Max Brunsfeld75901f1c33c9
diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rsindex 69d8cd460a9..57f78a16302 100644--- a/crates/collab_ui/src/collab_titlebar_item.rs+++ b/crates/collab_ui/src/collab_titlebar_item.rs@@ -119,12 +119,12 @@ impl View for CollabTitlebarItem {let status = &*status.borrow();if matches!(status, client::Status::Connected { .. }) {right_container.add_child(self.render_toggle_contacts_button(&theme, cx));+ right_container.add_child(self.render_user_menu_button(&theme, cx));} else {right_container.add_children(self.render_connection_status(status, cx));+ right_container.add_child(self.render_sign_in_button(&theme, cx));}- right_container.add_child(self.render_user_menu_button(&theme, cx));-Stack::new().with_child(left_container.boxed()).with_child(right_container.aligned().right().boxed())@@ -554,6 +554,22 @@ impl CollabTitlebarItem {.boxed()}+ fn render_sign_in_button(&self, theme: &Theme, cx: &mut RenderContext<Self>) -> ElementBox {+ let titlebar = &theme.workspace.titlebar;+ MouseEventHandler::<Authenticate>::new(0, cx, |state, _| {+ let style = titlebar.sign_in_prompt.style_for(state, false);+ Label::new("Sign In", style.text.clone())+ .contained()+ .with_style(style.container)+ .boxed()+ })+ .with_cursor_style(CursorStyle::PointingHand)+ .on_click(MouseButton::Left, move |_, cx| {+ cx.dispatch_action(Authenticate);+ })+ .boxed()+ }+fn render_contacts_popover_host<'a>(&'a self,theme: &'a theme::Titlebar,