Merge pull request #1485 from LukashonakV/master
Hide/Unhide temperature module when "format*" is empty.
This commit is contained in:
commit
8c6063d181
|
@ -34,6 +34,14 @@ auto waybar::modules::Temperature::update() -> void {
|
||||||
} else {
|
} else {
|
||||||
label_.get_style_context()->remove_class("critical");
|
label_.get_style_context()->remove_class("critical");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(format.empty()) {
|
||||||
|
event_box_.hide();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
event_box_.show();
|
||||||
|
}
|
||||||
|
|
||||||
auto max_temp = config_["critical-threshold"].isInt() ? config_["critical-threshold"].asInt() : 0;
|
auto max_temp = config_["critical-threshold"].isInt() ? config_["critical-threshold"].asInt() : 0;
|
||||||
label_.set_markup(fmt::format(format,
|
label_.set_markup(fmt::format(format,
|
||||||
fmt::arg("temperatureC", temperature_c),
|
fmt::arg("temperatureC", temperature_c),
|
||||||
|
|
Loading…
Reference in New Issue