feat(iced): make toolbox expandable/collapsible to 2 columns

This commit is contained in:
2026-07-16 13:08:34 +03:00
parent baf77632dc
commit edae18fca0
2 changed files with 64 additions and 8 deletions
+12 -1
View File
@@ -264,6 +264,8 @@ pub struct HcieIcedApp {
pub bool_shape_a: Option<usize>,
/// Boolean operation shape B selector index (geometry panel).
pub bool_shape_b: Option<usize>,
/// Whether the toolbox is expanded to 2 columns (false = single column 36px, true = 2 columns 72px).
pub sidebar_expanded: bool,
}
/// A recently opened file entry.
@@ -779,6 +781,9 @@ pub enum Message {
ViewerPrev,
ViewerNext,
ViewerEnter,
// ── Toolbox expand/collapse ─────────────────────────
SidebarToggleExpanded,
}
/// Convert a FilterType enum to the engine's string filter ID.
@@ -1113,6 +1118,7 @@ impl HcieIcedApp {
vector_drag_last: None,
bool_shape_a: None,
bool_shape_b: None,
sidebar_expanded: false,
};
// Apply saved settings to tool state
@@ -5147,6 +5153,10 @@ impl HcieIcedApp {
}
}
Message::SidebarToggleExpanded => {
self.sidebar_expanded = !self.sidebar_expanded;
}
Message::NoOp => {}
Message::TabletTouch { x, y, pressed } => {
@@ -5257,7 +5267,7 @@ impl HcieIcedApp {
self.active_menu,
);
// Toolbox — fixed 36px strip on the left edge (outside dock)
// Toolbox — 36px strip (single column) or 72px (2 columns) on the left edge
let toolbox = crate::sidebar::view(
&self.tool_state,
&self.fg_color,
@@ -5266,6 +5276,7 @@ impl HcieIcedApp {
self.active_tool_slot,
self.sub_tools_open,
&self.slot_last_used,
self.sidebar_expanded,
);
// Merged toolbar: icon buttons + tool options in one row