Support collapsing operations

This commit is contained in:
Hanno Braun 2024-12-12 23:19:41 +01:00
parent 788af1edc3
commit 3d1736b89e
2 changed files with 7 additions and 0 deletions

View File

@ -102,6 +102,9 @@ impl ApplicationHandler for App {
Key::Named(NamedKey::ArrowRight) => {
self.view.selected_mut().select_last();
}
Key::Named(NamedKey::ArrowLeft) => {
self.view.parent_of_selected_mut().select_none();
}
Key::Named(NamedKey::ArrowDown) => {
self.view.parent_of_selected_mut().select_next();
}

View File

@ -63,6 +63,10 @@ impl OperationView {
}
}
pub fn select_none(&mut self) {
self.selected = None;
}
pub fn selected(&self) -> &Self {
self.selected
.and_then(|selected| self.children.get(selected))