feat(iced): add dock profile management

This commit is contained in:
2026-07-15 17:35:34 +03:00
parent 6d51ee528a
commit 3c5a9e32a1
4 changed files with 310 additions and 2 deletions
@@ -6,6 +6,24 @@
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
/// A saved dock layout profile.
///
/// Stores a simplified pane layout description along with layout dimensions
/// so the user can save, load, rename, and delete dock configurations.
/// The full iced PaneGrid State cannot be serialized directly, so we store
/// the essential layout info: which panels are open and their relative positions.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DockProfile {
pub name: String,
/// List of panel names currently visible in the dock (e.g. "Layers", "History").
pub visible_panels: Vec<String>,
pub left_col1_w: f32,
pub left_col2_w: f32,
pub right_col1_w: f32,
pub right_col2_w: f32,
pub last_window_width: f32,
}
/// Main settings structure saved to disk.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AppSettings {
@@ -15,6 +33,9 @@ pub struct AppSettings {
pub panel_layout: PanelLayout,
/// Window settings.
pub window: WindowSettings,
/// Saved dock layout profiles.
#[serde(default)]
pub dock_profiles: Vec<DockProfile>,
}
/// Tool-specific settings that persist between sessions.
@@ -68,6 +89,7 @@ impl Default for AppSettings {
tool_settings: ToolSettings::default(),
panel_layout: PanelLayout::default(),
window: WindowSettings::default(),
dock_profiles: Vec::new(),
}
}
}