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.

Add setting to disable the sign in button (#30450)

Tristan Hume96a0568fb703
diff --git a/assets/settings/default.json b/assets/settings/default.json
index 6b743402f3d..1a24b4890dc 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 87f06d7034d..bb77e6ac43b 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 d2241084ce6..b6695bf6fb3 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,
}
}
}