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:
@@ -28,7 +28,7 @@ fn view_options() -> Vec<(usize, String)> {
|
||||
|
||||
pub fn main_menu_widget(app: &App, area: Rect, buf: &mut Buffer) {
|
||||
let vertical_layout: Layout =
|
||||
Layout::vertical([Constraint::Percentage(88), Constraint::Percentage(12)]);
|
||||
Layout::vertical([Constraint::Percentage(92), Constraint::Percentage(8)]);
|
||||
|
||||
let [main_menu_area, keybindings_area] = vertical_layout.areas(area);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user