mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
modules: Set style-context on button
Fixes issue where the class parameters in style.css would have no effect. The CSS now references the GtkButton instead of the GtkLabel. Removing all style-classes from the custom module GtkButton however removes any properties set via style.css. Thus, the default classes 'flat' and 'text-button' are added on every update of these modules.
This commit is contained in:
@ -352,9 +352,9 @@ auto waybar::modules::Battery::update() -> void {
|
||||
fmt::arg("time", time_remaining_formatted)));
|
||||
}
|
||||
if (!old_status_.empty()) {
|
||||
label_->get_style_context()->remove_class(old_status_);
|
||||
button_.get_style_context()->remove_class(old_status_);
|
||||
}
|
||||
label_->get_style_context()->add_class(status);
|
||||
button_.get_style_context()->add_class(status);
|
||||
old_status_ = status;
|
||||
if (!state.empty() && config_["format-" + status + "-" + state].isString()) {
|
||||
format = config_["format-" + status + "-" + state].asString();
|
||||
|
Reference in New Issue
Block a user