generated from GarandPLG/rust-flake-template
Refactor keybindings with groups and symbols
Introduce a `Group` enum to categorize actions and add `group` and `symbol` fields to `KeyBinding`. Extend `Action` with `Up`, `Down`, `Space`, and `Esc`, updating all keybinding definitions accordingly. Update `binding_for_view` to return the new actions per view and handle `Esc` by returning to the main menu. Rewrite the keybindings widget as a custom `Widget` that renders grouped paragraphs with proper layout. Adjust the main menu layout percentages to accommodate the new widget.
This commit is contained in:
@@ -103,6 +103,7 @@ impl App {
|
||||
if let Some(action) = event_to_action(&key_event) {
|
||||
match action {
|
||||
Action::Quit => self.exit = true,
|
||||
Action::Esc => self.view = View::MainMenu,
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user