feat(volume): Adding the volume widget in default config

This commit is contained in:
Patrick Marie 2024-05-05 20:46:44 +02:00
parent ff7d5bcdf2
commit 00b97ae13f
No known key found for this signature in database
GPG key ID: BB519E5CD8E7BFA7

View file

@ -189,75 +189,112 @@ pub fn layout() -> Widget {
Box::new(Texts::Text(String::from(""))), Box::new(Texts::Text(String::from(""))),
), ),
])), ])),
Some(Box::new(Texts::If( Some(Box::new(Texts::Parts(vec![
Condition::Not(Box::new(Condition::Stopped)), Texts::Parts(vec![
Box::new(Texts::Parts(vec![
Texts::Styled( Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(113))], vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::Parts(vec![ Box::new(Texts::Text(String::from("["))),
Texts::If(
Condition::Playing,
Box::new(Texts::Text(String::from("[playing: "))),
Some(Box::new(Texts::Text(String::from(
"[paused: ",
)))),
),
Texts::CurrentElapsed,
Texts::Text(String::from("/")),
Texts::CurrentDuration,
Texts::Text(String::from("] ")),
])),
), ),
Texts::If( Texts::If(
Condition::TitleExist, Condition::VolumeMuted,
Box::new(Texts::Parts(vec![ Box::new(Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::Text(String::from("muted"))),
)),
Some(Box::new(Texts::Parts(vec![
Texts::Styled( Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(149))], vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::CurrentTitle), Box::new(Texts::Text(String::from("vol: "))),
), ),
Texts::If( Texts::Styled(
Condition::ArtistExist, vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::Parts(vec![ Box::new(Texts::CurrentVolume),
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(216))],
Box::new(Texts::Text(String::from(""))),
),
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(185))],
Box::new(Texts::CurrentArtist),
),
Texts::If(
Condition::AlbumExist,
Box::new(Texts::Parts(vec![
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(
216,
))],
Box::new(Texts::Text(
String::from(""),
)),
),
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(
221,
))],
Box::new(Texts::CurrentAlbum),
),
])),
None,
),
])),
None,
), ),
])), Texts::Styled(
Some(Box::new(Texts::Styled( vec![AddStyle::Fg(Color::Indexed(113))],
vec![AddStyle::Fg(Color::Indexed(185))], Box::new(Texts::Text(String::from("%"))),
Box::new(Texts::CurrentFile), ),
))), ]))),
), ),
])), Texts::Styled(
None, vec![AddStyle::Fg(Color::Indexed(113))],
))), Box::new(Texts::Text(String::from("]"))),
),
]),
Texts::If(
Condition::Not(Box::new(Condition::Stopped)),
Box::new(Texts::Parts(vec![
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::Parts(vec![
Texts::If(
Condition::Playing,
Box::new(Texts::Text(String::from(
"[playing: ",
))),
Some(Box::new(Texts::Text(String::from(
"[paused: ",
)))),
),
Texts::CurrentElapsed,
Texts::Text(String::from("/")),
Texts::CurrentDuration,
Texts::Text(String::from("] ")),
])),
),
Texts::If(
Condition::TitleExist,
Box::new(Texts::Parts(vec![
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(149))],
Box::new(Texts::CurrentTitle),
),
Texts::If(
Condition::ArtistExist,
Box::new(Texts::Parts(vec![
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(216))],
Box::new(Texts::Text(String::from(
"",
))),
),
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(185))],
Box::new(Texts::CurrentArtist),
),
Texts::If(
Condition::AlbumExist,
Box::new(Texts::Parts(vec![
Texts::Styled(
vec![AddStyle::Fg(
Color::Indexed(216),
)],
Box::new(Texts::Text(
String::from(""),
)),
),
Texts::Styled(
vec![AddStyle::Fg(
Color::Indexed(221),
)],
Box::new(Texts::CurrentAlbum),
),
])),
None,
),
])),
None,
),
])),
Some(Box::new(Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(185))],
Box::new(Texts::CurrentFile),
))),
),
])),
None,
),
]))),
)), )),
)), )),
), ),