use gpui::Pixels; use schemars::JsonSchema; use serde_derive::{Deserialize, Serialize}; use settings::{Settings, SettingsSources}; use workspace::dock::DockPosition; #[derive(Deserialize, Debug)] pub struct GitPanelSettings { pub button: bool, pub dock: DockPosition, pub default_width: Pixels, } #[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)] pub struct PanelSettingsContent { /// Whether to show the panel button in the status bar. /// /// Default: true pub button: Option, /// Where to dock the panel. /// /// Default: left pub dock: Option, /// Default width of the panel in pixels. /// /// Default: 360 pub default_width: Option, } impl Settings for GitPanelSettings { const KEY: Option<&'static str> = Some("git_panel"); type FileContent = PanelSettingsContent; fn load( sources: SettingsSources, _: &mut gpui::AppContext, ) -> anyhow::Result { sources.json_merge() } }