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

@ -2130,6 +2130,39 @@ impl OpenCADStudio {
return Task::none();
}
// Keep the coordinate readout live on every move, even with no
// active command. When a command is running the snap path below
// overwrites this with the snapped point.
{
let bounds = iced::Rectangle {
x: 0.0,
y: 0.0,
width: vp_size.0,
height: vp_size.1,
};
let paper = if let Some(ref ucs) = self.tabs[i].active_ucs {
let origin = glam::Vec3::new(
ucs.origin.x as f32,
ucs.origin.y as f32,
ucs.origin.z as f32,
);
let normal = ucs_z_axis(ucs);
self.tabs[i]
.scene
.camera
.borrow()
.pick_on_plane(p, bounds, normal, origin)
} else {
self.tabs[i]
.scene
.camera
.borrow()
.pick_on_target_plane(p, bounds)
};
let world = self.tabs[i].scene.paper_to_model(paper);
self.tabs[i].last_cursor_world = world;
}
if self.tabs[i].active_cmd.is_some() {
let (vw, vh) = vp_size;
let bounds = iced::Rectangle {
@ -3530,6 +3563,23 @@ impl OpenCADStudio {
self.scale_popup_open = false;
Task::none()
}
Message::ToggleStatusBarMenu => {
self.statusbar_menu_open ^= true;
Task::none()
}
Message::CloseStatusBarMenu => {
self.statusbar_menu_open = false;
Task::none()
}
Message::ToggleStatusPill(pill) => {
// Keep the menu open so several pills can be toggled in a row.
self.statusbar_config.toggle(pill);
Task::none()
}
Message::ToggleCleanScreen => {
self.clean_screen ^= true;
Task::none()
}
Message::ToggleSnap(t) => {
self.snapper.toggle(t);
Task::none()