diff --git a/src/app/config.rs b/src/app/config.rs index 2e4d5e796..d9debc1a1 100644 --- a/src/app/config.rs +++ b/src/app/config.rs @@ -29,6 +29,10 @@ pub struct AppConfig { pub statusbar: StatusBarConfig, /// Dock position, width and auto-collapse behavior of the Properties panel. pub properties: PropertiesDockConfig, + /// General edge-stack dock layout (which panels are docked, side, order, + /// width and auto-collapse). Newer dock state; the Properties dock is + /// folded into this when its panel is migrated. + pub dock: crate::ui::dock::DockState, /// Add a newly selected annotation scale to existing annotative objects. pub annotation_auto_scale: i8, /// Ribbon collapse density. @@ -49,6 +53,7 @@ impl Default for AppConfig { start: StartConfig::default(), statusbar: StatusBarConfig::default(), properties: PropertiesDockConfig::default(), + dock: crate::ui::dock::DockState::default(), annotation_auto_scale: -4, ribbon: RibbonConfig::default(), plot: PlotDialogState::default(), diff --git a/src/app/mod.rs b/src/app/mod.rs index b9b6ba2a3..d70323b92 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -591,6 +591,8 @@ pub(super) struct OpenCADStudio { show_properties: bool, /// Docked Insert Block panel visibility. pub(crate) show_block_palette: bool, + /// General edge-stack dock layout for the side panels. + pub(crate) dock: crate::ui::dock::DockState, /// Docked Insert Block panel state (search, preview size, cached thumbnails). pub(crate) block_palette: crate::ui::window::block_palette::BlockPalette, /// Whether the narrow-window block-palette bar is expanded. @@ -3159,6 +3161,7 @@ impl OpenCADStudio { show_block_palette: false, block_palette: Default::default(), block_palette_expanded: false, + dock: Default::default(), show_file_tabs: true, show_layout_tabs: true, last_point: None, diff --git a/src/app/update/file.rs b/src/app/update/file.rs index 915357b27..fb42fe1df 100644 --- a/src/app/update/file.rs +++ b/src/app/update/file.rs @@ -558,6 +558,11 @@ impl OpenCADStudio { width: self.properties_width, auto_collapse: self.properties_auto_collapse, }, + dock: { + let mut dock = self.dock.clone(); + dock.ensure_settings(); + dock + }, annotation_auto_scale: self.annotation_auto_scale, ribbon: crate::app::config::RibbonConfig { collapse: self.ribbon.collapse_mode(), @@ -602,6 +607,9 @@ impl OpenCADStudio { 250.0 }; self.properties_auto_collapse = cfg.properties.auto_collapse; + let mut dock = cfg.dock; + dock.ensure_settings(); + self.dock = dock; self.annotation_auto_scale = cfg.annotation_auto_scale.clamp(-4, 4); self.ribbon.set_collapse_mode(cfg.ribbon.collapse); self.plot_dialog = cfg.plot;