hide mdp/pulseaudio/sndio if text 'resolves' to be empty.

This commit is contained in:
Prokhor40
2022-12-02 18:08:56 +03:00
parent 2111865efe
commit b74f3c7aaa
3 changed files with 32 additions and 8 deletions

View File

@ -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();
}