feat(props): editable block Name row + collapsible XYZ groups

- Block reference Name (Misc) is editable: the dropdown re-points the
  insert to another definition; typing a new name renames the definition
  everywhere (record re-key, Block marker, every INSERT reference).
  Anonymous (*) and xref blocks stay read-only, with the same guards
  added to Scene::rename_block.
- Custom single-control dropdown (text field + caret) built on the
  shared floating_below overlay so the list always opens downward,
  unlike iced's space-based menu placement.
- Consecutive "<Base> X/Y/Z" rows (Position, Scale, Start, Center, ...)
  collapse into one expandable summary row across all entities; the
  expand state persists across rebuilds and selection changes.
- The BEDIT block tab no longer offers the layout Rename/Delete
  context menu.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-22 11:11:10 +03:00
commit b5dbef5776
10 changed files with 583 additions and 51 deletions

View file

@ -2695,6 +2695,20 @@ impl OpenCADStudio {
Message::PropGeomCommit(field) => self.on_prop_geom_commit(field),
Message::PropGroupToggle(key) => {
let groups = &mut self.tabs[self.active_tab].properties.expanded_groups;
if !groups.remove(&key) {
groups.insert(key);
}
Task::none()
}
Message::PropEditChoiceToggle => {
let panel = &mut self.tabs[self.active_tab].properties;
panel.edit_choice_open = !panel.edit_choice_open;
Task::none()
}
Message::PropAttrInput { tag, value } => {
self.tabs[self.active_tab]
.properties
@ -2896,7 +2910,14 @@ impl OpenCADStudio {
}
Message::LayoutContextMenu(name) => {
if name != "Model" {
// No menu on the transient BEDIT block tab: Rename/Delete are
// layout operations and don't apply to it.
let is_block_tab = self.tabs[self.active_tab]
.block_edit
.as_ref()
.map(|be| be.block_name == name)
.unwrap_or(false);
if name != "Model" && !is_block_tab {
self.layout_context_menu = Some(name);
}
Task::none()