Merge pull request #1551 from loserMcloser/keyboard-state-css-classes

Add classes to individual keyboard state labels
This commit is contained in:
Alex
2022-05-12 13:55:32 +02:00
committed by GitHub
2 changed files with 9 additions and 1 deletions

View File

@ -103,12 +103,15 @@ waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Bar&
dev_(nullptr) {
box_.set_name("keyboard-state");
if (config_["numlock"].asBool()) {
numlock_label_.get_style_context()->add_class("numlock");
box_.pack_end(numlock_label_, false, false, 0);
}
if (config_["capslock"].asBool()) {
capslock_label_.get_style_context()->add_class("capslock");
box_.pack_end(capslock_label_, false, false, 0);
}
if (config_["scrolllock"].asBool()) {
scrolllock_label_.get_style_context()->add_class("scrolllock");
box_.pack_end(scrolllock_label_, false, false, 0);
}
if (!id.empty()) {