mirror of
https://github.com/talwat/lowfi
synced 2025-12-19 13:13:21 +00:00
fix: default of params
This commit is contained in:
parent
89da41c9ff
commit
4b2fac3529
@ -131,8 +131,8 @@ mod interface {
|
|||||||
ui::{Interface, State},
|
ui::{Interface, State},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn loading() {
|
async fn loading() {
|
||||||
let sink = Arc::new(rodio::Sink::new().0);
|
let sink = Arc::new(rodio::Sink::new().0);
|
||||||
let mut state = State::initial(sink, String::from("test"));
|
let mut state = State::initial(sink, String::from("test"));
|
||||||
let menu = Interface::default().menu(&mut state);
|
let menu = Interface::default().menu(&mut state);
|
||||||
@ -150,8 +150,8 @@ mod interface {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn volume() {
|
async fn volume() {
|
||||||
let sink = Arc::new(rodio::Sink::new().0);
|
let sink = Arc::new(rodio::Sink::new().0);
|
||||||
sink.set_volume(0.5);
|
sink.set_volume(0.5);
|
||||||
|
|
||||||
@ -172,8 +172,8 @@ mod interface {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn progress() {
|
async fn progress() {
|
||||||
let sink = Arc::new(rodio::Sink::new().0);
|
let sink = Arc::new(rodio::Sink::new().0);
|
||||||
PROGRESS.store(50, std::sync::atomic::Ordering::Relaxed);
|
PROGRESS.store(50, std::sync::atomic::Ordering::Relaxed);
|
||||||
let mut state = State::initial(sink, String::from("test"));
|
let mut state = State::initial(sink, String::from("test"));
|
||||||
@ -194,8 +194,8 @@ mod interface {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn track() {
|
async fn track() {
|
||||||
let sink = Arc::new(rodio::Sink::new().0);
|
let sink = Arc::new(rodio::Sink::new().0);
|
||||||
let track = tracks::Info {
|
let track = tracks::Info {
|
||||||
path: "/path".to_owned(),
|
path: "/path".to_owned(),
|
||||||
|
|||||||
@ -12,7 +12,7 @@ pub use clock::Clock;
|
|||||||
pub use window::Window;
|
pub use window::Window;
|
||||||
|
|
||||||
/// UI-specific parameters and options.
|
/// UI-specific parameters and options.
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct Params {
|
pub struct Params {
|
||||||
/// Whether to include borders.
|
/// Whether to include borders.
|
||||||
pub borderless: bool,
|
pub borderless: bool,
|
||||||
@ -37,6 +37,19 @@ pub struct Params {
|
|||||||
pub delta: Duration,
|
pub delta: Duration,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Params {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
borderless: false,
|
||||||
|
minimalist: false,
|
||||||
|
enabled: true,
|
||||||
|
clock: false,
|
||||||
|
width: 27,
|
||||||
|
delta: Duration::from_secs_f32(1.0 / 12.0),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl TryFrom<&Args> for Params {
|
impl TryFrom<&Args> for Params {
|
||||||
type Error = ui::Error;
|
type Error = ui::Error;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user