feat(mpd): Add playing / paused classes

This commit is contained in:
Minijackson
2019-04-18 14:30:50 +02:00
parent 38e37f3680
commit 0ce8821aec
2 changed files with 14 additions and 1 deletions

View File

@ -104,8 +104,17 @@ void waybar::modules::MPD::setLabel() {
format =
config_["format-stopped"].isString() ? config_["format-stopped"].asString() : "stopped";
label_.get_style_context()->add_class("stopped");
label_.get_style_context()->remove_class("playing");
label_.get_style_context()->remove_class("paused");
} else {
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();