add ::OverlayReset

This commit is contained in:
galister
2026-01-05 21:32:19 +09:00
parent 85b6032586
commit 97a7038fd9

View File

@@ -287,6 +287,27 @@ pub(super) fn setup_custom_button<S: 'static>(
Ok(EventResult::Consumed)
})
}
"::OverlayReset" => {
let arg: Arc<str> = args.collect::<Vec<_>>().join(" ").into();
if arg.len() < 1 {
log::error!("{command} has missing arguments");
return;
};
Box::new(move |_common, data, app, _| {
if !test_button(data) || !test_duration(&button, app) {
return Ok(EventResult::Pass);
}
app.tasks.enqueue(TaskType::Overlay(OverlayTask::Modify(
OverlaySelector::Name(arg.clone()),
Box::new(move |app, owc| {
owc.activate(app);
}),
)));
Ok(EventResult::Consumed)
})
}
"::OverlayToggle" => {
let arg: Arc<str> = args.collect::<Vec<_>>().join(" ").into();
if arg.len() < 1 {