refactor(custon): avoid useless logic

This commit is contained in:
Alex 2019-05-27 00:08:16 +02:00
parent be2fa743eb
commit 6e69af8967
1 changed files with 20 additions and 21 deletions

View File

@ -102,7 +102,9 @@ auto waybar::modules::Custom::update() -> void {
} else {
parseOutputRaw();
}
if (text_.empty()) {
event_box_.hide();
} else {
auto str = fmt::format(format_,
text_,
fmt::arg("alt", alt_),
@ -123,9 +125,6 @@ auto waybar::modules::Custom::update() -> void {
for (auto const& c : class_) {
label_.get_style_context()->add_class(c);
}
if (text_.empty()) {
event_box_.hide();
} else {
event_box_.show();
}
}