Merge pull request #693 from f0rki/current_output

sway/workspaces added current_output CSS class to buttons.
This commit is contained in:
Alex 2020-05-04 17:36:36 +02:00 committed by GitHub
commit 81abd9bb67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -128,3 +128,4 @@ n.b.: the list of outputs can be obtained from command line using *swaymsg -t ge
- *#workspaces button.focused*
- *#workspaces button.urgent*
- *#workspaces button.persistent*
- *#workspaces button.current_output*

View File

@ -154,6 +154,15 @@ auto Workspaces::update() -> void {
} else {
button.get_style_context()->remove_class("persistent");
}
if ((*it)["output"].isString()) {
if (((*it)["output"].asString()) == bar_.output->name) {
button.get_style_context()->add_class("current_output");
} else {
button.get_style_context()->remove_class("current_output");
}
} else {
button.get_style_context()->remove_class("current_output");
}
if (needReorder) {
box_.reorder_child(button, it - workspaces_.begin());
}