Add "empty" class for Image module when path/exec is returning an empty value.

pull/2859/head
Paul Rey 2024-01-23 18:15:47 +01:00 committed by GitHub
parent 0d9c492998
commit 0af8f5c691
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -87,3 +87,4 @@ $path\\n$tooltip
# STYLE # STYLE
- *#image* - *#image*
- *#image.empty*

View File

@ -63,9 +63,11 @@ auto waybar::modules::Image::update() -> void {
} }
image_.set(pixbuf); image_.set(pixbuf);
image_.show(); image_.show();
image_.get_style_context()->remove_class("empty");
} else { } else {
image_.clear(); image_.clear();
image_.hide(); image_.hide();
image_.get_style_context()->add_class("empty");
} }
AModule::update(); AModule::update();