mirror of
https://github.com/figsoda/mmtc
synced 2024-11-22 15:13:03 +00:00
feat(volume): Adding the volume widget in default config
This commit is contained in:
parent
ff7d5bcdf2
commit
00b97ae13f
1 changed files with 98 additions and 61 deletions
|
@ -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,
|
||||||
))),
|
),
|
||||||
|
]))),
|
||||||
)),
|
)),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue