feat(statusbar): drawing-units pill with INSUNITS picker

Add a Units pill that shows the drawing's current INSUNITS value and
opens a picker to change it (Unitless, mm, cm, m, km, in, ft, mi, yd).
Toggleable from the status-bar customization menu like the other pills.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-04 22:06:42 +03:00
commit 243a0bc923
7 changed files with 219 additions and 0 deletions

View file

@ -3580,6 +3580,21 @@ impl OpenCADStudio {
self.clean_screen ^= true;
Task::none()
}
Message::ToggleUnitsPopup => {
self.units_popup_open ^= true;
Task::none()
}
Message::CloseUnitsPopup => {
self.units_popup_open = false;
Task::none()
}
Message::SetDrawingUnits(code) => {
self.units_popup_open = false;
let i = self.active_tab;
self.tabs[i].scene.document.header.insertion_units = code;
self.tabs[i].dirty = true;
Task::none()
}
Message::ToggleSnap(t) => {
self.snapper.toggle(t);
Task::none()