rework and improve tool bar pop menus

This commit is contained in:
Stewart Allen 2024-06-05 17:36:35 -07:00
commit 3a97903017
9 changed files with 179 additions and 129 deletions

View file

@ -29,6 +29,20 @@ function annotate(id) {
return (w.anno = w.anno || {});
}
function rename() {
let widgets = api.selection.widgets(true);
if (widgets.length !== 1) {
return;
}
let widget = widgets[0];
const newname = prompt("new widget name", widget.meta.file);
if (newname) {
widget.meta.file = newname;
api.platform.changed();
api.space.save(true);
}
}
function replace(vertices) {
let widgets = api.selection.widgets(true);
if (!widgets.length) {
@ -82,6 +96,7 @@ const widgets = api.widgets = {
new: newWidget,
map,
meshes,
rename,
replace,
opacity,
annotate,