diff --git a/crates/title_bar/src/title_bar_settings.rs b/crates/title_bar/src/title_bar_settings.rs index d2241084ce62b977bf0fced47334ecbe3586247c..5fc0fb3b1d729d48a95bef594ca895d8a565cb5b 100644 --- a/crates/title_bar/src/title_bar_settings.rs +++ b/crates/title_bar/src/title_bar_settings.rs @@ -3,47 +3,43 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use settings::{Settings, SettingsSources}; -#[derive(Copy, Clone, Serialize, Deserialize, JsonSchema, Debug)] -#[serde(default)] +#[derive(Copy, Clone, Deserialize, Debug)] pub struct TitleBarSettings { + pub show_branch_icon: bool, + pub show_onboarding_banner: bool, + pub show_user_picture: bool, + pub show_branch_name: bool, + pub show_project_items: bool, +} + +#[derive(Copy, Clone, Default, Serialize, Deserialize, JsonSchema, Debug)] +pub struct TitleBarSettingsContent { /// Whether to show the branch icon beside branch switcher in the title bar. /// /// Default: false - pub show_branch_icon: bool, + pub show_branch_icon: Option, /// Whether to show onboarding banners in the title bar. /// /// Default: true - pub show_onboarding_banner: bool, + pub show_onboarding_banner: Option, /// Whether to show user avatar in the title bar. /// /// Default: true - pub show_user_picture: bool, + pub show_user_picture: Option, /// Whether to show the branch name button in the titlebar. /// /// Default: true - pub show_branch_name: bool, + pub show_branch_name: Option, /// Whether to show the project host and name in the titlebar. /// /// Default: true - pub show_project_items: bool, -} - -impl Default for TitleBarSettings { - fn default() -> Self { - Self { - show_branch_icon: false, - show_onboarding_banner: true, - show_user_picture: true, - show_branch_name: true, - show_project_items: true, - } - } + pub show_project_items: Option, } impl Settings for TitleBarSettings { const KEY: Option<&'static str> = Some("title_bar"); - type FileContent = Self; + type FileContent = TitleBarSettingsContent; fn load(sources: SettingsSources, _: &mut gpui::App) -> anyhow::Result where