fix context menus, reload-from-disk

This commit is contained in:
galister
2026-01-08 03:27:45 +09:00
parent 150e6c4e40
commit bc52ff825e
2 changed files with 11 additions and 4 deletions

View File

@@ -107,7 +107,7 @@
<!-- An app with a single icon. --> <!-- An app with a single icon. -->
<template name="App"> <template name="App">
<Button macro="button_style" id="overlay_${idx}" tooltip_str="${name}" _press="::ContextMenuOpen menu_app"> <Button macro="button_style" id="overlay_${idx}" tooltip_str="${name}" _context_name="${name}" _press="::ContextMenuOpen menu_app">
<sprite width="38" height="38" color="~text_color" src_ext="${icon}" /> <sprite width="38" height="38" color="~text_color" src_ext="${icon}" />
</Button> </Button>
</template> </template>
@@ -140,7 +140,7 @@
</blueprint> </blueprint>
<template name="Panel"> <template name="Panel">
<Button macro="button_style" id="overlay_${idx}" tooltip_str="${name}" _press="::ContextMenuOpen menu_panel"> <Button macro="button_style" id="overlay_${idx}" tooltip_str="${name}" _context_name="${name}" _press="::ContextMenuOpen menu_panel">
<sprite width="38" height="38" color="~text_color" src_builtin="edit/panel.svg" /> <sprite width="38" height="38" color="~text_color" src_builtin="edit/panel.svg" />
</Button> </Button>
</template> </template>
@@ -155,7 +155,7 @@
</blueprint> </blueprint>
<template name="Mirror"> <template name="Mirror">
<Button macro="button_style" id="overlay_${idx}" tooltip_str="${name}" _press="::ContextMenuOpen menu_mirror"> <Button macro="button_style" id="overlay_${idx}" tooltip_str="${name}" _context_name="${name}" _press="::ContextMenuOpen menu_mirror">
<sprite width="38" height="38" color="~text_color" src_builtin="edit/mirror.svg" /> <sprite width="38" height="38" color="~text_color" src_builtin="edit/mirror.svg" />
<div position="absolute" margin_top="5" margin_left="13"> <div position="absolute" margin_top="5" margin_left="13">
<label text="${display}" size="20" color="~color_faded_20" weight="bold" /> <label text="${display}" size="20" color="~color_faded_20" weight="bold" />

View File

@@ -423,7 +423,14 @@ pub(super) fn setup_custom_button<S: 'static>(
))); )));
app.tasks.enqueue(TaskType::Overlay(OverlayTask::Create( app.tasks.enqueue(TaskType::Overlay(OverlayTask::Create(
OverlaySelector::Name(owc.name.clone()), OverlaySelector::Name(owc.name.clone()),
Box::new(move |app| create_custom(app, name)), Box::new(move |app| {
if let Some(mut owc) = create_custom(app, name) {
owc.show_on_spawn = true;
Some(owc)
} else {
None
}
}),
))); )));
}), }),
))); )));