mirror of
https://github.com/talwat/lowfi
synced 2024-12-26 03:01:55 +00:00
feat: convert width to an arbitrary unit to avoid uneven setups
This commit is contained in:
parent
a6f3eb034d
commit
a39d903c68
@ -67,9 +67,9 @@ struct Args {
|
||||
#[clap(long, short)]
|
||||
debug: bool,
|
||||
|
||||
/// The width of the player
|
||||
#[clap(long, short)]
|
||||
width: Option<usize>,
|
||||
/// 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')]
|
||||
|
@ -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<Player>, sender: Sender<Messages>, 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?;
|
||||
|
Loading…
Reference in New Issue
Block a user