bar functionality

This commit is contained in:
galister
2026-01-05 03:57:56 +09:00
parent c3e04e0a89
commit 4dd7c85e79
9 changed files with 330 additions and 151 deletions

View File

@@ -248,7 +248,8 @@ pub(super) fn setup_custom_button<S: 'static>(
})
}
"::OverlayToggle" => {
let Some(arg): Option<Arc<str>> = args.next().map(Into::into) else {
let arg: Arc<str> = args.collect::<Vec<_>>().join(" ").into();
if arg.len() < 1 {
log::error!("{command} has missing arguments");
return;
};
@@ -271,6 +272,24 @@ pub(super) fn setup_custom_button<S: 'static>(
Ok(EventResult::Consumed)
})
}
"::OverlaySoftToggle" => {
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::SoftToggleOverlay(
OverlaySelector::Name(arg.clone()),
)));
Ok(EventResult::Consumed)
})
}
"::EditToggle" => Box::new(move |_common, data, app, _| {
if !test_button(data) || !test_duration(&button, app) {
return Ok(EventResult::Pass);