forked from 1b-agent/fieldcraft-upstream
Browser and viewport: item menu, per-item eyes, Delete key with confirmation
Right-click on any browser item (body, surface, datum, partition, set, material, section, step, boundary condition, load, reference point, coupling, contact, fluid domain) opens its menu: Edit…, Hide/Show, Isolate, Show All, Active in step (boundary conditions and loads) and Delete…. A right click on a datum or a partition's cut face in the viewport opens the same menu. Each item the viewport draws on its own has an eye; hidden items are neither drawn nor picked. Datums and partitions are selectable with properties. Delete… and the Delete key ask first (the prompt lists what uses the item: a datum's partitions are deleted with it, other definitions in use are refused); ui.prompt answers it. Every entry runs the same command as the ribbon and forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
d7ec7f486a
commit
08f669acad
12 files changed
+646
-78
No files matched your search
@@ -253,16 +253,19 @@ fn properties(app: &mut ModelApp, ui: &mut egui::Ui, t: &Tokens, kind: Def, name
|
||||
});
|
||||
ui.add_space(6.0);
|
||||
let (mut edit, mut delete) = (false, false);
|
||||
let editing = kind.edit_command(&app.session.model, name);
|
||||
ui.horizontal(|ui| {
|
||||
edit = ui.button("Edit…").on_hover_text(kind.command("edit")).clicked();
|
||||
delete = ui.button("Delete").on_hover_text(kind.command("delete")).clicked();
|
||||
if let Some(command) = &editing {
|
||||
edit = ui.button("Edit…").on_hover_text(command).clicked();
|
||||
}
|
||||
delete = ui.button("Delete…").on_hover_text(format!("{} (Delete key)", kind.command("delete"))).clicked();
|
||||
});
|
||||
if deselect {
|
||||
app.selected = None;
|
||||
} else if edit && let Some(v) = browser::definition(&app.session.model, kind, name) {
|
||||
app.open_form(&kind.command("edit"), v);
|
||||
} else if delete && app.run(&kind.command("delete"), json!({"name": name})).is_ok() {
|
||||
app.selected = None;
|
||||
} else if edit && let Some((command, params)) = kind.edit(&app.session.model, name) {
|
||||
app.open_form(&command, params);
|
||||
} else if delete {
|
||||
app.ask_delete(kind, name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user