feat: hide module if empty

This commit is contained in:
Daan Goossens
2022-05-07 13:42:27 +02:00
parent 3043d42a89
commit e235f48245
2 changed files with 3 additions and 0 deletions

View File

@ -171,6 +171,8 @@ auto waybar::modules::Bluetooth::update() -> void {
tooltip_format = config_["tooltip-format"].asString();
}
format_.empty() ? event_box_.hide() : event_box_.show();
auto update_style_context = [this](const std::string& style_class, bool in_next_state) {
if (in_next_state && !label_.get_style_context()->has_class(style_class)) {
label_.get_style_context()->add_class(style_class);