generated from GarandPLG/rust-flake-template
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:
1 parent
bf8883934d
commit
f405c3cde1
8 files changed
+82
-60
No files matched your search
@@ -0,0 +1,13 @@
|
||||
pub fn main_menu_option_helper(s: String) -> String {
|
||||
if let Some(pos) = s
|
||||
.char_indices()
|
||||
.filter(|(_, c)| c.is_ascii_uppercase())
|
||||
.nth(1)
|
||||
.map(|(i, _)| i)
|
||||
{
|
||||
let (first, second) = s.split_at(pos);
|
||||
format!("{first} {second}")
|
||||
} else {
|
||||
s
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user