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<bool>, /// Where to dock the panel. /// /// Default: left pub dock: Option<DockPosition>, /// Default width of the panel in pixels. /// /// Default: 360 pub default_width: Option<f32>,} impl Settings for GitPanelSettings { const KEY: Option<&'static str> = Some("git_panel"); type FileContent = PanelSettingsContent; fn load( sources: SettingsSources<Self::FileContent>, _: &mut gpui::AppContext, ) -> anyhow::Result<Self> { sources.json_merge() }}
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<bool>,
/// Where to dock the panel.
///
/// Default: left
pub dock: Option<DockPosition>,
/// Default width of the panel in pixels.
///
/// Default: 360
pub default_width: Option<f32>,
}
impl Settings for GitPanelSettings {
const KEY: Option<&'static str> = Some("git_panel");
type FileContent = PanelSettingsContent;
fn load(
sources: SettingsSources<Self::FileContent>,
_: &mut gpui::AppContext,
) -> anyhow::Result<Self> {
sources.json_merge()
}
}