diff --git a/src/main.rs b/src/main.rs index a2cc896..428386c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,9 +67,9 @@ struct Args { #[clap(long, short)] debug: bool, - /// The width of the player - #[clap(long, short)] - width: Option, + /// The width of the player, from 0 to 32. + #[clap(long, short, default_value_t = 3)] + width: usize, /// This is either a path, or a name of a file in the data directory (eg. ~/.local/share/lowfi). #[clap(long, short, alias = "list", short_alias = 'l')] diff --git a/src/player/ui.rs b/src/player/ui.rs index 8711320..8ab5a63 100644 --- a/src/player/ui.rs +++ b/src/player/ui.rs @@ -27,9 +27,6 @@ use super::{Messages, Player}; mod components; mod input; -/// The default total width of the UI. -const DEFAULT_WIDTH: usize = 27; - /// Self explanitory. const FPS: usize = 12; @@ -240,7 +237,7 @@ pub async fn start(player: Arc, sender: Sender, args: Args) -> let interface = task::spawn(interface( Arc::clone(&player), args.minimalist, - args.width.unwrap_or(DEFAULT_WIDTH).max(21), + 21 + args.width.min(32) * 2, )); input::listen(sender.clone()).await?;