forked from 1b-agent/opencadstudio-upstream
feat(blocks): switch dynamic-block visibility states from a lookup grip
A block reference with a visibility parameter now shows a triangular lookup grip at the parameter point. Clicking it opens a dropdown of the named states (current one marked); picking a state toggles which of the anonymous block's members are visible and rebuilds, so the reference shows the chosen profile instead of being frozen on the saved state. The state list is data-driven (owned strings from the file) and applying it mutates other entities (the anonymous block's members), so it stays separate from the static GripMenuAction grip-menu: a dedicated VisibilityPopup and an app-level apply path. The anonymous block is a parallel-ordered clone of its definition, so a member visible in the definition's state maps to the same index in the inserted block; the chosen visibility flags round-trip through the DWG writer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f54b1241f
commit
9b1bd011ca
6 files changed
+321
-1
No files matched your search
@@ -71,6 +71,8 @@ pub(super) struct DocumentTab {
|
||||
pub(super) active_grip: Option<GripEdit>,
|
||||
pub(super) selected_grips: Vec<GripDef>,
|
||||
pub(super) selected_handle: Option<Handle>,
|
||||
/// Dynamic-block visibility grip for the current single selection.
|
||||
pub(super) visibility_grip: Option<super::visibility::VisibilityGrip>,
|
||||
pub(super) wireframe: bool,
|
||||
pub(super) render_mode: acadrust::entities::ViewportRenderMode,
|
||||
pub(super) visual_style: String,
|
||||
@@ -134,6 +136,7 @@ impl DocumentTab {
|
||||
active_grip: None,
|
||||
selected_grips: vec![],
|
||||
selected_handle: None,
|
||||
visibility_grip: None,
|
||||
wireframe: false,
|
||||
render_mode: acadrust::entities::ViewportRenderMode::Wireframe2D,
|
||||
visual_style: "Wireframe 2D".into(),
|
||||
|
||||
Reference in new issue
Block a user