mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix(custom): hide on empty format
This commit is contained in:
parent
918146c16b
commit
9dbf057f58
@ -102,14 +102,14 @@ auto waybar::modules::Custom::update() -> void {
|
|||||||
} else {
|
} else {
|
||||||
parseOutputRaw();
|
parseOutputRaw();
|
||||||
}
|
}
|
||||||
if (text_.empty()) {
|
|
||||||
event_box_.hide();
|
|
||||||
} else {
|
|
||||||
auto str = fmt::format(format_,
|
auto str = fmt::format(format_,
|
||||||
text_,
|
text_,
|
||||||
fmt::arg("alt", alt_),
|
fmt::arg("alt", alt_),
|
||||||
fmt::arg("icon", getIcon(percentage_, alt_)),
|
fmt::arg("icon", getIcon(percentage_, alt_)),
|
||||||
fmt::arg("percentage", percentage_));
|
fmt::arg("percentage", percentage_));
|
||||||
|
if (str.empty()) {
|
||||||
|
event_box_.hide();
|
||||||
|
} else {
|
||||||
label_.set_markup(str);
|
label_.set_markup(str);
|
||||||
if (tooltipEnabled()) {
|
if (tooltipEnabled()) {
|
||||||
if (text_ == tooltip_) {
|
if (text_ == tooltip_) {
|
||||||
|
Loading…
Reference in New Issue
Block a user