mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
hide mdp/pulseaudio/sndio if text 'resolves' to be empty.
This commit is contained in:
@ -110,7 +110,14 @@ auto Sndio::update() -> void {
|
||||
label_.get_style_context()->remove_class("muted");
|
||||
}
|
||||
|
||||
label_.set_markup(fmt::format(format, fmt::arg("volume", vol), fmt::arg("raw_value", volume_)));
|
||||
auto text = fmt::format(format, fmt::arg("volume", vol), fmt::arg("raw_value", volume_));
|
||||
if(text.empty()) {
|
||||
label_.hide();
|
||||
} else {
|
||||
label_.set_markup(text);
|
||||
label_.show();
|
||||
}
|
||||
|
||||
|
||||
ALabel::update();
|
||||
}
|
||||
|
Reference in New Issue
Block a user