Track window area and refactor keybinding APIs

- Track terminal size in `App::window_area` and update on resize
- Accept action slices in `count_largest_group` and
  `KeybindingsWidget::new`
- Add ACTIONS slices and layout helpers for default, main_menu, skirmish
- Add `main_menu_option_helper` for formatting menu strings and export
  it
This commit is contained in:
GarandPLG committed 2026-04-01 20:27:50 +02:00
1 parent bf8883934d
commit f405c3cde1
8 files changed
+82 -60

No files matched your search

+2 -2
View File
@@ -32,12 +32,12 @@ impl KeybindingsWidget {
///
/// # Parameters
///
/// * `actions` – A vector of actions for which keybindings should be shown.
/// * `actions` – A slice of actions for which keybindings should be shown.
///
/// # Returns
///
/// A fully‑initialised `KeybindingsWidget` ready for rendering.
pub fn new(actions: Vec<Action>) -> Self {
pub fn new(actions: &[Action]) -> Self {
let keybindings: Vec<Option<&'static KeyBinding>> =
actions.iter().map(|a| binding_for(*a)).collect();