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,7 +189,39 @@ 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![
Texts::Parts(vec![
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::Text(String::from("["))),
),
Texts::If(
Condition::VolumeMuted,
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(
vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::Text(String::from("vol: "))),
),
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::CurrentVolume),
),
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::Text(String::from("%"))),
),
]))),
),
Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(113))],
Box::new(Texts::Text(String::from("]"))),
),
]),
Texts::If(
Condition::Not(Box::new(Condition::Stopped)), Condition::Not(Box::new(Condition::Stopped)),
Box::new(Texts::Parts(vec![ Box::new(Texts::Parts(vec![
Texts::Styled( Texts::Styled(
@ -197,7 +229,9 @@ pub fn layout() -> Widget {
Box::new(Texts::Parts(vec![ Box::new(Texts::Parts(vec![
Texts::If( Texts::If(
Condition::Playing, Condition::Playing,
Box::new(Texts::Text(String::from("[playing: "))), Box::new(Texts::Text(String::from(
"[playing: ",
))),
Some(Box::new(Texts::Text(String::from( Some(Box::new(Texts::Text(String::from(
"[paused: ", "[paused: ",
)))), )))),
@ -220,7 +254,9 @@ pub fn layout() -> Widget {
Box::new(Texts::Parts(vec![ Box::new(Texts::Parts(vec![
Texts::Styled( Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(216))], vec![AddStyle::Fg(Color::Indexed(216))],
Box::new(Texts::Text(String::from(""))), Box::new(Texts::Text(String::from(
"",
))),
), ),
Texts::Styled( Texts::Styled(
vec![AddStyle::Fg(Color::Indexed(185))], vec![AddStyle::Fg(Color::Indexed(185))],
@ -230,17 +266,17 @@ pub fn layout() -> Widget {
Condition::AlbumExist, Condition::AlbumExist,
Box::new(Texts::Parts(vec![ Box::new(Texts::Parts(vec![
Texts::Styled( Texts::Styled(
vec![AddStyle::Fg(Color::Indexed( vec![AddStyle::Fg(
216, Color::Indexed(216),
))], )],
Box::new(Texts::Text( Box::new(Texts::Text(
String::from(""), String::from(""),
)), )),
), ),
Texts::Styled( Texts::Styled(
vec![AddStyle::Fg(Color::Indexed( vec![AddStyle::Fg(
221, Color::Indexed(221),
))], )],
Box::new(Texts::CurrentAlbum), Box::new(Texts::CurrentAlbum),
), ),
])), ])),
@ -257,7 +293,8 @@ pub fn layout() -> Widget {
), ),
])), ])),
None, None,
))), ),
]))),
)), )),
)), )),
), ),