From 96a0568fb703939a884e4fdaf3ca47e54e269a67 Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Wed, 14 May 2025 09:39:04 -0400 Subject: [PATCH] Add setting to disable the sign in button (#30450) Designed to pair with #30444 to enable enterprises to make it harder to sign into the collab server and perhaps accidentally end up sending code to Zed. Release Notes: - N/A Co-authored-by: Mikayla Maki --- assets/settings/default.json | 4 +++- crates/title_bar/src/title_bar.rs | 4 +++- crates/title_bar/src/title_bar_settings.rs | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index 6b743402f3d44a5c862693d22e627089691c7a23..1a24b4890dcb78b5dbb044cff9f0ee79a9f4622c 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -335,7 +335,9 @@ // Whether to show onboarding banners in the titlebar. "show_onboarding_banner": true, // Whether to show user picture in the titlebar. - "show_user_picture": true + "show_user_picture": true, + // Whether to show the sign in button in the titlebar. + "show_sign_in": true }, // Scrollbar related settings "scrollbar": { diff --git a/crates/title_bar/src/title_bar.rs b/crates/title_bar/src/title_bar.rs index 87f06d7034da255572df77525314b9da8aa3fddc..bb77e6ac43baf7bff98dcfebd89c843d7618f6ff 100644 --- a/crates/title_bar/src/title_bar.rs +++ b/crates/title_bar/src/title_bar.rs @@ -237,7 +237,9 @@ impl Render for TitleBar { el.child(self.render_user_menu_button(cx)) } else { el.children(self.render_connection_status(status, cx)) - .child(self.render_sign_in_button(cx)) + .when(TitleBarSettings::get_global(cx).show_sign_in, |el| { + el.child(self.render_sign_in_button(cx)) + }) .child(self.render_user_menu_button(cx)) } }), diff --git a/crates/title_bar/src/title_bar_settings.rs b/crates/title_bar/src/title_bar_settings.rs index d2241084ce62b977bf0fced47334ecbe3586247c..b6695bf6fb30e37aeb51137c02600e5aec8ec45e 100644 --- a/crates/title_bar/src/title_bar_settings.rs +++ b/crates/title_bar/src/title_bar_settings.rs @@ -26,6 +26,10 @@ pub struct TitleBarSettings { /// /// Default: true pub show_project_items: bool, + /// Whether to show the sign in button in the title bar. + /// + /// Default: true + pub show_sign_in: bool, } impl Default for TitleBarSettings { @@ -36,6 +40,7 @@ impl Default for TitleBarSettings { show_user_picture: true, show_branch_name: true, show_project_items: true, + show_sign_in: true, } } }