feat(model-space): theme-aware model space canvas and CAD selection/grip sysvars

Model space appearance now follows the active UI theme instead of a
hardcoded dark background. Canvas mode is user-selectable (Match Theme /
Classic CAD Dark / Custom RGB), with matching controls for the paper
sheet and desk surround backgrounds and grid opacity.
Implements industry-standard CAD system variables, all settable via
command name, SETVAR, and the Options dialog:
- COLORTHEME (0/1 dark/light UI scheme, preserves custom palettes)
- COLORSCHEME (interactive named-theme selection)
- BACKGROUND (THEME/CLASSIC/DEFAULT/DESK presets, RGB triplets)
- SELECTIONAREA, SELECTIONAREAOPACITY (translucent marquee fill)
- WINDOWSAREACOLOR/WINDOWAREACOLOR, CROSSINGAREACOLOR (ACI or theme)
- SELECTIONEFFECT, SELECTIONEFFECTCOLOR (GPU highlight pass, driven by
  selection_generation invalidation — no retessellation)
- SELECTIONPREVIEW (bit 0 = idle rollover, bit 1 = in-command hover)
- GRIPSIZE, GRIPCOLOR, GRIPHOT, GRIPHOVER (grip overlay styling)
This commit is contained in:
Karim Jerbi committed 2026-09-03 17:44:44 +01:00
1 parent 89b1a22850
commit 688785a6cf
18 files changed
+1949 -316

No files matched your search

+15 -6
View File
@@ -2270,13 +2270,17 @@ impl OpenCADStudio {
)
})?
});
let highlights_hover = self.tabs[i]
.active_cmd
.as_ref()
.map(|c| c.entity_pick_highlights_hover())
.unwrap_or(false);
let preview_in_command = (self.model_space.selection_preview & 2) != 0;
let highlights_hover = preview_in_command
&& self.tabs[i]
.active_cmd
.as_ref()
.map(|c| c.entity_pick_highlights_hover())
.unwrap_or(false);
if highlights_hover {
self.tabs[i].scene.set_hover_highlight(hovered);
} else {
self.tabs[i].scene.set_hover_highlight(None);
}
let hover_handle = hovered.unwrap_or(acadrust::Handle::NULL);
let shift = self.shift_down;
@@ -5118,7 +5122,12 @@ impl OpenCADStudio {
);
solid_ms = started.elapsed().as_secs_f64() * 1000.0;
}
self.tabs[i].scene.set_hover_highlight(hovered);
let preview_idle = (self.model_space.selection_preview & 1) != 0;
if preview_idle {
self.tabs[i].scene.set_hover_highlight(hovered);
} else {
self.tabs[i].scene.set_hover_highlight(None);
}
self.hover_dwell = None;
let hover_ms = hover_started.elapsed().as_secs_f64() * 1000.0;
if perf && hover_ms >= 5.0 {