diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index 69d8cd460a..57f78a1630 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) -> ElementBox { + let titlebar = &theme.workspace.titlebar; + MouseEventHandler::::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,