Merge pull request #959 from dorgnarg/fix-section-css-classes

Fix for group module selectors when bar is vertical
This commit is contained in:
Alex 2020-12-28 23:15:46 +01:00 committed by GitHub
commit f233d27b78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -370,9 +370,6 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config)
window.get_style_context()->add_class(output->name); window.get_style_context()->add_class(output->name);
window.get_style_context()->add_class(config["name"].asString()); window.get_style_context()->add_class(config["name"].asString());
window.get_style_context()->add_class(config["position"].asString()); window.get_style_context()->add_class(config["position"].asString());
left_.get_style_context()->add_class("modules-left");
center_.get_style_context()->add_class("modules-center");
right_.get_style_context()->add_class("modules-right");
if (config["layer"] == "top") { if (config["layer"] == "top") {
layer_ = bar_layer::TOP; layer_ = bar_layer::TOP;
@ -390,6 +387,10 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config)
vertical = true; vertical = true;
} }
left_.get_style_context()->add_class("modules-left");
center_.get_style_context()->add_class("modules-center");
right_.get_style_context()->add_class("modules-right");
uint32_t height = config["height"].isUInt() ? config["height"].asUInt() : 0; uint32_t height = config["height"].isUInt() ? config["height"].asUInt() : 0;
uint32_t width = config["width"].isUInt() ? config["width"].asUInt() : 0; uint32_t width = config["width"].isUInt() ? config["width"].asUInt() : 0;