Make the view toggles survive a restart, and give them a page

The ViewCube, the UCS icon, its at-origin placement and selection cycling all
have commands and status-bar pills, and all four kept their value only on the
app struct. Turn the ViewCube off with NAVVCUBE, restart, and it is back.
Nothing failed — the setting evaporated — so a checkbox for any of them would
have been a checkbox that forgets. They are persisted first, with a
round-trip test, and only then given controls.

The new 3D Modeling page carries the three view tools plus the drawing
variables that decide how solids are tessellated: ISOLINES, DISPSILH, SURFU,
SURFV, SURFTYPE, SOLIDHIST and SHOWHIST. Those are saved in the DWG rather
than in preferences, so the page says so beside each group and hides them
entirely when no drawing is open.

Changing them also rebuilds the geometry. The SETVAR path never did, which is
why the comment beside LTSCALE's invalidation exists — the same reasoning
applies here, and without it a new isoline count does not appear until some
unrelated edit rebuilds the solid.

Selection cycling joins the Selection page next to the other two selection
modes, since that is what it is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
PanosandClaude Opus 5 committed 2026-09-10 08:41:26 +03:00
1 parent b5f4b4d1cc
commit 5a638f243a
7 files changed
+427

No files matched your search

+23
View File
@@ -4149,6 +4149,29 @@ mod grip_limit_tests {
);
}
/// The ViewCube, the UCS icon and selection cycling all have commands and
/// status-bar pills, but their values lived only on the app struct: turn
/// the ViewCube off, restart, and it came straight back. Nothing failed —
/// the setting simply evaporated — which is exactly the kind of thing a
/// round-trip test catches and a person does not.
#[test]
fn the_view_toggles_survive_a_save_and_load() {
let mut app = OpenCADStudio::new_for_test();
app.show_viewcube = false;
app.show_ucs_icon = false;
app.ucs_icon_at_origin = false;
app.selection_cycling = true;
let saved = app.current_settings();
let mut restored = OpenCADStudio::new_for_test();
restored.apply_settings(&saved);
assert!(!restored.show_viewcube, "the ViewCube must stay off");
assert!(!restored.show_ucs_icon);
assert!(!restored.ucs_icon_at_origin);
assert!(restored.selection_cycling);
}
/// The Options card writes these four straight onto the app and relies on
/// the snapshot/restore pair to carry them across a restart. Three of them
/// had no UI until now and so no reason for anyone to notice if the pair