feat(statusbar): scrollable layout tabs + layout-list dropdown (#199)

Keep the right-side status-bar tools from being pushed off the bar when a
drawing has many layouts: the layout tabs now live in a horizontal scrollable
that only takes the space left between the menu and the tools, with ‹ › arrows
(and the mouse wheel) to scroll them.

Repurpose the leftmost hamburger — which previously fired a no-op MENU command
— to open a dropdown listing Model and every layout (scrollable, current
highlighted); picking one switches to it, an outside click dismisses it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-27 14:24:47 +03:00
commit 3def2f2034
5 changed files with 173 additions and 9 deletions

View file

@ -213,6 +213,11 @@ impl OpenCADStudio {
Task::none()
}
Message::ScrollLayoutTabs(dx) => iced::widget::operation::scroll_by(
iced::advanced::widget::Id::new(crate::ui::statusbar::LAYOUT_TABS_SCROLL_ID),
iced::widget::scrollable::AbsoluteOffset { x: dx, y: 0.0 },
),
Message::OpenRecent(path) => {
// Recents are read from disk every save → the path may be
// stale. Skip silently if the file no longer exists; the
@ -1336,6 +1341,14 @@ impl OpenCADStudio {
self.scale_popup_open = false;
Task::none()
}
Message::ToggleLayoutList => {
self.layout_list_open ^= true;
Task::none()
}
Message::CloseLayoutList => {
self.layout_list_open = false;
Task::none()
}
Message::ToggleStatusBarMenu => {
self.statusbar_menu_open ^= true;
Task::none()
@ -1946,7 +1959,10 @@ impl OpenCADStudio {
Task::none()
}
Message::LayoutSwitch(name) => self.on_layout_switch(name),
Message::LayoutSwitch(name) => {
self.layout_list_open = false;
self.on_layout_switch(name)
}
Message::LayoutCreate => self.on_layout_create(),