Merge pull request #2170 from FintasticMan/hide_mpris_if_empty
mpris: Hide label if empty
This commit is contained in:
commit
5b29119dab
|
@ -630,7 +630,12 @@ auto Mpris::update() -> void {
|
||||||
fmt::arg("player_icon", getIconFromJson(config_["player-icons"], info.name)),
|
fmt::arg("player_icon", getIconFromJson(config_["player-icons"], info.name)),
|
||||||
fmt::arg("status_icon", getIconFromJson(config_["status-icons"], info.status_string)));
|
fmt::arg("status_icon", getIconFromJson(config_["status-icons"], info.status_string)));
|
||||||
|
|
||||||
|
if (label_format.empty()) {
|
||||||
|
label_.hide();
|
||||||
|
} else {
|
||||||
label_.set_markup(label_format);
|
label_.set_markup(label_format);
|
||||||
|
label_.show();
|
||||||
|
}
|
||||||
} catch (fmt::format_error const& e) {
|
} catch (fmt::format_error const& e) {
|
||||||
spdlog::warn("mpris: format error: {}", e.what());
|
spdlog::warn("mpris: format error: {}", e.what());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue