mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(pulseaudio): add muted class
This commit is contained in:
parent
b85289f7ce
commit
291267711a
@ -59,3 +59,8 @@ window {
|
|||||||
background: #f1c40f;
|
background: #f1c40f;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pulseaudio.muted {
|
||||||
|
background: #90b1b1;
|
||||||
|
color: #2a5c45;
|
||||||
|
}
|
||||||
|
@ -100,9 +100,13 @@ void waybar::modules::Pulseaudio::_serverInfoCb(pa_context *context,
|
|||||||
auto waybar::modules::Pulseaudio::update() -> void
|
auto waybar::modules::Pulseaudio::update() -> void
|
||||||
{
|
{
|
||||||
auto format = _config["format"] ? _config["format"].asString() : "{}%";
|
auto format = _config["format"] ? _config["format"].asString() : "{}%";
|
||||||
if (_muted)
|
if (_muted) {
|
||||||
format =
|
format =
|
||||||
_config["format-muted"] ? _config["format-muted"].asString() : format;
|
_config["format-muted"] ? _config["format-muted"].asString() : format;
|
||||||
|
if (!_label.get_style_context()->has_class("muted"))
|
||||||
|
_label.get_style_context()->add_class("muted");
|
||||||
|
} else if (_label.get_style_context()->has_class("muted"))
|
||||||
|
_label.get_style_context()->remove_class("muted");
|
||||||
_label.set_text(fmt::format(format, _volume));
|
_label.set_text(fmt::format(format, _volume));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user