mirror of
https://github.com/talwat/lowfi
synced 2024-12-26 19:21:54 +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)]
|
#[clap(long, short)]
|
||||||
debug: bool,
|
debug: bool,
|
||||||
|
|
||||||
/// The width of the player
|
/// The width of the player, from 0 to 32.
|
||||||
#[clap(long, short)]
|
#[clap(long, short, default_value_t = 3)]
|
||||||
width: Option<usize>,
|
width: usize,
|
||||||
|
|
||||||
/// This is either a path, or a name of a file in the data directory (eg. ~/.local/share/lowfi).
|
/// 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')]
|
#[clap(long, short, alias = "list", short_alias = 'l')]
|
||||||
|
@ -27,9 +27,6 @@ use super::{Messages, Player};
|
|||||||
mod components;
|
mod components;
|
||||||
mod input;
|
mod input;
|
||||||
|
|
||||||
/// The default total width of the UI.
|
|
||||||
const DEFAULT_WIDTH: usize = 27;
|
|
||||||
|
|
||||||
/// Self explanitory.
|
/// Self explanitory.
|
||||||
const FPS: usize = 12;
|
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(
|
let interface = task::spawn(interface(
|
||||||
Arc::clone(&player),
|
Arc::clone(&player),
|
||||||
args.minimalist,
|
args.minimalist,
|
||||||
args.width.unwrap_or(DEFAULT_WIDTH).max(21),
|
21 + args.width.min(32) * 2,
|
||||||
));
|
));
|
||||||
|
|
||||||
input::listen(sender.clone()).await?;
|
input::listen(sender.clone()).await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user