rework and improve tool bar pop menus
This commit is contained in:
parent
9a02408e7b
commit
3a97903017
9 changed files with 179 additions and 129 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue