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:
parent
1f54b1241f
commit
9b1bd011ca
6 changed files with 321 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ mod style_ops;
|
|||
mod text_inline;
|
||||
mod update;
|
||||
mod view;
|
||||
mod visibility;
|
||||
|
||||
pub use style_ops::StyleKind;
|
||||
|
||||
|
|
@ -240,6 +241,8 @@ pub(super) struct OpenCADStudio {
|
|||
/// until dismissed (click outside, ESC, cursor leaves the grip).
|
||||
grip_popup: Option<GripPopup>,
|
||||
grip_pending: Option<GripPendingValue>,
|
||||
/// Open dynamic-block visibility-state dropdown.
|
||||
visibility_popup: Option<visibility::VisibilityPopup>,
|
||||
/// A leader line just added via the "Add Leader" grip menu whose arrow is
|
||||
/// being placed (follows the cursor). `(entity handle, new-arrow grip id)`.
|
||||
/// Esc before the placement click removes it again.
|
||||
|
|
@ -748,6 +751,9 @@ pub enum Message {
|
|||
/// User picked an item in the multi-functional grip popup menu —
|
||||
/// the index is into `grip_popup.items`.
|
||||
GripMenuPick(usize),
|
||||
/// User picked a dynamic-block visibility state — index into the
|
||||
/// visibility dropdown's items.
|
||||
VisibilityPick(usize),
|
||||
/// Timer pulse while the cursor is dwelling on a grip; drives the
|
||||
/// dwell-to-popup transition without requiring further mouse motion.
|
||||
GripDwellTick,
|
||||
|
|
@ -1324,6 +1330,7 @@ impl OpenCADStudio {
|
|||
grip_hover: None,
|
||||
grip_popup: None,
|
||||
grip_pending: None,
|
||||
visibility_popup: None,
|
||||
grip_add_provisional: None,
|
||||
grip_preview_handle: None,
|
||||
grip_original: None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue