forked from 1b-agent/opencadstudio-upstream
feat(ui): unified viewport control chip + per-tile grid rendering
Move grid and grid-snap toggles off the status bar (and its customization menu) into the top-left viewport chip, now a single container holding the horizontal/vertical split buttons, render-mode picker, and grid/snap toggles, sized to the render-mode picker. Add grid + magnet (snap) icons. Render the grid per model tile from each tile's own grid_on, in its own bounds and camera, instead of a single grid in the active tile. This stops the grid flickering on/off as the cursor crosses panes or leaves the viewport, and lets each pane show its own grid independently. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
d4a665a34c
commit
9eb805df23
8 files changed
+170
-133
No files matched your search
@@ -32,7 +32,6 @@ impl StatusBar {
|
||||
ortho_mode: bool,
|
||||
polar_mode: bool,
|
||||
polar_increment_deg: f32,
|
||||
show_grid: bool,
|
||||
dyn_input: bool,
|
||||
otrack: bool,
|
||||
layouts: Vec<String>,
|
||||
@@ -94,7 +93,6 @@ impl StatusBar {
|
||||
|
||||
// ── Right side ────────────────────────────────────────────────────
|
||||
let osnap_active = snapper.is_active();
|
||||
let snap_grid_on = snapper.is_on(crate::snap::SnapType::Grid) && snapper.snap_enabled;
|
||||
|
||||
let vp_label = if viewport_count > 0 {
|
||||
format!("{} VP", viewport_count)
|
||||
@@ -126,18 +124,6 @@ impl StatusBar {
|
||||
"Cursor coordinates (X, Y, Z)",
|
||||
));
|
||||
}
|
||||
if vis(StatusPill::Snap) {
|
||||
right_status = right_status.push(tip(
|
||||
toggle_pill("SNAP", snap_grid_on, Message::ToggleGridSnap),
|
||||
"Snap to Grid\nF9",
|
||||
));
|
||||
}
|
||||
if vis(StatusPill::Grid) {
|
||||
right_status = right_status.push(tip(
|
||||
toggle_pill("GRID", show_grid, Message::ToggleGrid),
|
||||
"Show Grid\nF7",
|
||||
));
|
||||
}
|
||||
if vis(StatusPill::Ortho) {
|
||||
right_status = right_status.push(tip(
|
||||
toggle_pill("ORTHO", ortho_mode, Message::ToggleOrtho),
|
||||
|
||||
Reference in new issue
Block a user