generated from GarandPLG/rust-flake-template
Add zoom support and dynamic keybinding layout
Introduce ZoomIn/ZoomOut actions and a Zoom group with corresponding keybindings. Add a CLI option to set the initial zoom level and a ZoomLevel enum. Expose a utility to compute the largest keybinding group size for layout sizing. Refactor board widget to adjust cell dimensions based on zoom level and simplify offset calculations. Update views to use the new layout sizing helper and integrate zoom handling in skirmish logic.
This commit is contained in:
+10
-1
@@ -1,5 +1,5 @@
|
||||
use crate::app::{
|
||||
states::{GameMode, PerkDecks},
|
||||
states::{GameMode, PerkDecks, ZoomLevel},
|
||||
view::View,
|
||||
};
|
||||
use clap::{Error, Parser, error::ErrorKind, value_parser};
|
||||
@@ -52,6 +52,15 @@ pub struct Cli {
|
||||
)]
|
||||
pub map_height: u8,
|
||||
|
||||
#[arg(
|
||||
long,
|
||||
help = "Zoom level",
|
||||
value_name = "...",
|
||||
default_value_t = ZoomLevel::Default,
|
||||
value_enum
|
||||
)]
|
||||
pub zoom_level: ZoomLevel,
|
||||
|
||||
#[arg(
|
||||
long,
|
||||
help = "Perk Deck",
|
||||
|
||||
Reference in New Issue
Block a user