Merge pull request #1551 from loserMcloser/keyboard-state-css-classes
Add classes to individual keyboard state labels
This commit is contained in:
commit
9bc821bdac
|
@ -79,4 +79,9 @@ The following *format-icons* can be set.
|
||||||
- *#keyboard-state*
|
- *#keyboard-state*
|
||||||
- *#keyboard-state label*
|
- *#keyboard-state label*
|
||||||
- *#keyboard-state label.locked*
|
- *#keyboard-state label.locked*
|
||||||
|
- *#keyboard-state label.numlock*
|
||||||
|
- *#keyboard-state label.numlock.locked*
|
||||||
|
- *#keyboard-state label.capslock*
|
||||||
|
- *#keyboard-state label.capslock.locked*
|
||||||
|
- *#keyboard-state label.scrolllock*
|
||||||
|
- *#keyboard-state label.scrolllock.locked*
|
||||||
|
|
|
@ -103,12 +103,15 @@ waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Bar&
|
||||||
dev_(nullptr) {
|
dev_(nullptr) {
|
||||||
box_.set_name("keyboard-state");
|
box_.set_name("keyboard-state");
|
||||||
if (config_["numlock"].asBool()) {
|
if (config_["numlock"].asBool()) {
|
||||||
|
numlock_label_.get_style_context()->add_class("numlock");
|
||||||
box_.pack_end(numlock_label_, false, false, 0);
|
box_.pack_end(numlock_label_, false, false, 0);
|
||||||
}
|
}
|
||||||
if (config_["capslock"].asBool()) {
|
if (config_["capslock"].asBool()) {
|
||||||
|
capslock_label_.get_style_context()->add_class("capslock");
|
||||||
box_.pack_end(capslock_label_, false, false, 0);
|
box_.pack_end(capslock_label_, false, false, 0);
|
||||||
}
|
}
|
||||||
if (config_["scrolllock"].asBool()) {
|
if (config_["scrolllock"].asBool()) {
|
||||||
|
scrolllock_label_.get_style_context()->add_class("scrolllock");
|
||||||
box_.pack_end(scrolllock_label_, false, false, 0);
|
box_.pack_end(scrolllock_label_, false, false, 0);
|
||||||
}
|
}
|
||||||
if (!id.empty()) {
|
if (!id.empty()) {
|
||||||
|
|
Loading…
Reference in New Issue