G2 (#67): delete Project items with Delete and Backspace

This commit is contained in:
Jonas Neubauer
2026-10-05 18:24:14 +02:00
parent e5c58600fd
commit 41f5ee3aec
3 changed files with 159 additions and 2 deletions
+13 -2
View File
@@ -1307,9 +1307,20 @@ pub fn handle_shortcuts(app: &mut EffectcraftApp, ctx: &egui::Context) {
if key == egui::Key::Enter && !mods.any() && app.ui.focused == PanelKind::Project {
continue;
}
// Delete/Backspace clears selection.
// The Project panel has its own selection; a previously selected Timeline layer
// must not be deleted while the Project panel has focus.
if matches!(key, egui::Key::Delete | egui::Key::Backspace) && !mods.any() {
let _ = invoke(app, ctx, "edit.clear", json!({}));
let command = if app.ui.focused == PanelKind::Project {
if app.session.state.project_selection.is_empty() {
continue;
}
"project.delete"
} else {
"edit.clear"
};
if let Err(e) = invoke(app, ctx, command, json!({})) {
app.ui.status = e;
}
continue;
}
if let Some((_, _, id, params)) = binds.iter().find(|(m, k, ..)| *k == key && mods_match(*m, mods)) {