Merge pull request #3034 from wispl/master

Add empty workspace style for Sway
This commit is contained in:
Alexis Rouillard 2024-03-22 23:13:29 +01:00 committed by GitHub
commit 38634a0ca8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -182,5 +182,6 @@ 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.empty*
- *#workspaces button.current_output*
- *#workspaces button#sway-workspace-${name}*

View File

@ -319,6 +319,11 @@ auto Workspaces::update() -> void {
} else {
button.get_style_context()->remove_class("persistent");
}
if ((*it)["nodes"].size() == 0) {
button.get_style_context()->add_class("empty");
} else {
button.get_style_context()->remove_class("empty");
}
if ((*it)["output"].isString()) {
if (((*it)["output"].asString()) == bar_.output->name) {
button.get_style_context()->add_class("current_output");