feat(config): persist general edge-stack dock layout
This commit is contained in:
parent
20be91ccaa
commit
dce555f5bc
3 changed files with 16 additions and 0 deletions
|
|
@ -29,6 +29,10 @@ pub struct AppConfig {
|
||||||
pub statusbar: StatusBarConfig,
|
pub statusbar: StatusBarConfig,
|
||||||
/// Dock position, width and auto-collapse behavior of the Properties panel.
|
/// Dock position, width and auto-collapse behavior of the Properties panel.
|
||||||
pub properties: PropertiesDockConfig,
|
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.
|
/// Add a newly selected annotation scale to existing annotative objects.
|
||||||
pub annotation_auto_scale: i8,
|
pub annotation_auto_scale: i8,
|
||||||
/// Ribbon collapse density.
|
/// Ribbon collapse density.
|
||||||
|
|
@ -49,6 +53,7 @@ impl Default for AppConfig {
|
||||||
start: StartConfig::default(),
|
start: StartConfig::default(),
|
||||||
statusbar: StatusBarConfig::default(),
|
statusbar: StatusBarConfig::default(),
|
||||||
properties: PropertiesDockConfig::default(),
|
properties: PropertiesDockConfig::default(),
|
||||||
|
dock: crate::ui::dock::DockState::default(),
|
||||||
annotation_auto_scale: -4,
|
annotation_auto_scale: -4,
|
||||||
ribbon: RibbonConfig::default(),
|
ribbon: RibbonConfig::default(),
|
||||||
plot: PlotDialogState::default(),
|
plot: PlotDialogState::default(),
|
||||||
|
|
|
||||||
|
|
@ -591,6 +591,8 @@ pub(super) struct OpenCADStudio {
|
||||||
show_properties: bool,
|
show_properties: bool,
|
||||||
/// Docked Insert Block panel visibility.
|
/// Docked Insert Block panel visibility.
|
||||||
pub(crate) show_block_palette: bool,
|
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).
|
/// Docked Insert Block panel state (search, preview size, cached thumbnails).
|
||||||
pub(crate) block_palette: crate::ui::window::block_palette::BlockPalette,
|
pub(crate) block_palette: crate::ui::window::block_palette::BlockPalette,
|
||||||
/// Whether the narrow-window block-palette bar is expanded.
|
/// Whether the narrow-window block-palette bar is expanded.
|
||||||
|
|
@ -3159,6 +3161,7 @@ impl OpenCADStudio {
|
||||||
show_block_palette: false,
|
show_block_palette: false,
|
||||||
block_palette: Default::default(),
|
block_palette: Default::default(),
|
||||||
block_palette_expanded: false,
|
block_palette_expanded: false,
|
||||||
|
dock: Default::default(),
|
||||||
show_file_tabs: true,
|
show_file_tabs: true,
|
||||||
show_layout_tabs: true,
|
show_layout_tabs: true,
|
||||||
last_point: None,
|
last_point: None,
|
||||||
|
|
|
||||||
|
|
@ -558,6 +558,11 @@ impl OpenCADStudio {
|
||||||
width: self.properties_width,
|
width: self.properties_width,
|
||||||
auto_collapse: self.properties_auto_collapse,
|
auto_collapse: self.properties_auto_collapse,
|
||||||
},
|
},
|
||||||
|
dock: {
|
||||||
|
let mut dock = self.dock.clone();
|
||||||
|
dock.ensure_settings();
|
||||||
|
dock
|
||||||
|
},
|
||||||
annotation_auto_scale: self.annotation_auto_scale,
|
annotation_auto_scale: self.annotation_auto_scale,
|
||||||
ribbon: crate::app::config::RibbonConfig {
|
ribbon: crate::app::config::RibbonConfig {
|
||||||
collapse: self.ribbon.collapse_mode(),
|
collapse: self.ribbon.collapse_mode(),
|
||||||
|
|
@ -602,6 +607,9 @@ impl OpenCADStudio {
|
||||||
250.0
|
250.0
|
||||||
};
|
};
|
||||||
self.properties_auto_collapse = cfg.properties.auto_collapse;
|
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.annotation_auto_scale = cfg.annotation_auto_scale.clamp(-4, 4);
|
||||||
self.ribbon.set_collapse_mode(cfg.ribbon.collapse);
|
self.ribbon.set_collapse_mode(cfg.ribbon.collapse);
|
||||||
self.plot_dialog = cfg.plot;
|
self.plot_dialog = cfg.plot;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue