From 9dbf057f58e4d5aa2ae7f1725e6d6f3af89dc744 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 3 Jun 2019 09:50:35 +0200 Subject: [PATCH] fix(custom): hide on empty format --- src/modules/custom.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index d6afce53..ca095088 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -102,14 +102,14 @@ auto waybar::modules::Custom::update() -> void { } else { parseOutputRaw(); } - if (text_.empty()) { + auto str = fmt::format(format_, + text_, + fmt::arg("alt", alt_), + fmt::arg("icon", getIcon(percentage_, alt_)), + fmt::arg("percentage", percentage_)); + if (str.empty()) { event_box_.hide(); } else { - auto str = fmt::format(format_, - text_, - fmt::arg("alt", alt_), - fmt::arg("icon", getIcon(percentage_, alt_)), - fmt::arg("percentage", percentage_)); label_.set_markup(str); if (tooltipEnabled()) { if (text_ == tooltip_) {