mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(mpd): Add playing / paused classes
This commit is contained in:
parent
38e37f3680
commit
0ce8821aec
@ -140,7 +140,7 @@ window#waybar.hidded {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#mpd {
|
#mpd {
|
||||||
background-color: #ba2880;
|
background: #ba2880;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mpd.disconnected {
|
#mpd.disconnected {
|
||||||
@ -151,3 +151,7 @@ window#waybar.hidded {
|
|||||||
background: #90b1b1;
|
background: #90b1b1;
|
||||||
color: #2a5c45;
|
color: #2a5c45;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#mpd.paused {
|
||||||
|
background: #ce68a6;
|
||||||
|
}
|
||||||
|
@ -104,8 +104,17 @@ void waybar::modules::MPD::setLabel() {
|
|||||||
format =
|
format =
|
||||||
config_["format-stopped"].isString() ? config_["format-stopped"].asString() : "stopped";
|
config_["format-stopped"].isString() ? config_["format-stopped"].asString() : "stopped";
|
||||||
label_.get_style_context()->add_class("stopped");
|
label_.get_style_context()->add_class("stopped");
|
||||||
|
label_.get_style_context()->remove_class("playing");
|
||||||
|
label_.get_style_context()->remove_class("paused");
|
||||||
} else {
|
} else {
|
||||||
label_.get_style_context()->remove_class("stopped");
|
label_.get_style_context()->remove_class("stopped");
|
||||||
|
if (playing()) {
|
||||||
|
label_.get_style_context()->add_class("playing");
|
||||||
|
label_.get_style_context()->remove_class("paused");
|
||||||
|
} else {
|
||||||
|
label_.get_style_context()->add_class("paused");
|
||||||
|
label_.get_style_context()->remove_class("playing");
|
||||||
|
}
|
||||||
|
|
||||||
stateIcon = getStateIcon();
|
stateIcon = getStateIcon();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user