feat(statusbar): selection cycling shows a pick list, adds to selection

Replace the repeat-click cycling with a list box: when a click lands on
two or more overlapping objects (cycling on), a small list of the
candidates opens at the cursor. Picking a row adds that object to the
current selection (accumulate); clicking outside dismisses it. A single
object under the cursor falls through to the normal click.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-04 23:56:24 +03:00
commit bcbda65746
5 changed files with 137 additions and 28 deletions

View file

@ -1014,6 +1014,24 @@ impl OpenCADStudio {
}
}
// Selection-cycling list box: pick among overlapping objects.
if let Some((pt, cands)) = &self.cycle_candidates {
if !tab.is_start {
let items: Vec<(acadrust::Handle, String)> = cands
.iter()
.filter_map(|&h| {
tab.scene.document.get_entity(h).map(|e| {
(h, crate::entities::traits::entity_type_name(e).to_string())
})
})
.collect();
if !items.is_empty() {
viewport_stack = viewport_stack
.push(crate::ui::cycle_popup::cycle_popup_overlay(*pt, items));
}
}
}
// Right-click context menu. Lives inside the viewport stack so
// the cursor position (canvas-relative) anchors the menu under
// the cursor instead of drifting into window-relative space.