feat(statusbar): customizable pills with coordinates and clean screen

Add a customization menu (far-right handle) that lists every status-bar
pill with a check mark; toggling a row shows or hides that pill, and the
choice persists across sessions in the config dir.

New pills:
- Coordinates: live cursor readout (re-adds the model-space world offset
  so it shows true drawing coordinates), updated on every move rather
  than only while a command is active.
- Clean Screen: hide the ribbon and side panels for a full canvas.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-04 19:14:04 +03:00
commit d829f80a04
7 changed files with 482 additions and 33 deletions

View file

@ -1057,7 +1057,7 @@ impl OpenCADStudio {
// Replace the properties panel with a Recent Documents list there.
let properties_el: Element<'_, Message> = if tab.is_start {
recent_files_panel(&self.app_menu.recent)
} else if self.show_properties {
} else if self.show_properties && !self.clean_screen {
tab.properties.view()
} else {
Space::new().into()
@ -1100,11 +1100,16 @@ impl OpenCADStudio {
.height(Fill);
let main_ui = container({
let mut col = column![self.ribbon.view(
is_paper,
self.tabs[self.active_tab].history.undo_stack.len(),
self.tabs[self.active_tab].history.redo_stack.len(),
)];
// Clean-screen mode drops the ribbon for a full-canvas view; the
// status bar stays so the mode can be toggled back off.
let mut col = column![];
if !self.clean_screen {
col = col.push(self.ribbon.view(
is_paper,
self.tabs[self.active_tab].history.undo_stack.len(),
self.tabs[self.active_tab].history.redo_stack.len(),
));
}
if self.show_file_tabs {
col = col.push(doc_tab_bar(&self.tabs, self.active_tab));
}
@ -1114,6 +1119,22 @@ impl OpenCADStudio {
let scale_pill_enabled = is_model
|| tab.scene.active_viewport.is_some()
|| tab.scene.has_selected_viewport();
// The cursor is tracked in local render space; re-add the
// model-space world offset so the readout shows true
// drawing coordinates (paper space carries no offset).
let cursor_coord = {
let lc = tab.last_cursor_world;
if is_model {
let wo = tab.scene.world_offset;
glam::Vec3::new(
lc.x + wo[0] as f32,
lc.y + wo[1] as f32,
lc.z + wo[2] as f32,
)
} else {
lc
}
};
self.status_bar.view(
&self.snapper,
self.snap_popup_open,
@ -1134,6 +1155,9 @@ impl OpenCADStudio {
self.scale_popup_open,
scale_pill_enabled,
tab.scene.document.header.lineweight_display,
cursor_coord,
self.clean_screen,
&self.statusbar_config,
)
})
.width(Fill)
@ -1169,6 +1193,12 @@ impl OpenCADStudio {
iced::widget::Space::new().width(0).height(0).into()
};
let statusbar_menu_layer: Element<'_, Message> = if self.statusbar_menu_open {
crate::ui::statusbar_menu::statusbar_menu_overlay(&self.statusbar_config)
} else {
iced::widget::Space::new().width(0).height(0).into()
};
let dropdown_layer: Element<'_, Message> = self
.ribbon
.dropdown_overlay(
@ -1204,6 +1234,7 @@ impl OpenCADStudio {
self.app_menu.view(),
snap_layer,
scale_layer,
statusbar_menu_layer,
dropdown_layer,
layout_ctx_layer,
qselect_layer,