Skip to content

Commit

Permalink
Merge pull request #3099 from kkvark/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays authored Apr 1, 2024
2 parents ddc767c + 9b4fc6d commit 3de9e0c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/sway/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,13 @@ auto Workspaces::update() -> void {
if (needReorder) {
box_.reorder_child(button, it - workspaces_.begin());
}
bool noNodes = (*it)["nodes"].empty() && (*it)["floating_nodes"].empty();
if (hasFlag((*it), "focused")) {
button.get_style_context()->add_class("focused");
} else {
button.get_style_context()->remove_class("focused");
}
if (hasFlag((*it), "visible") || ((*it)["output"].isString() && (*it)["nodes"].size() == 0)) {
if (hasFlag((*it), "visible") || ((*it)["output"].isString() && noNodes )) {
button.get_style_context()->add_class("visible");
} else {
button.get_style_context()->remove_class("visible");
Expand All @@ -319,7 +320,7 @@ auto Workspaces::update() -> void {
} else {
button.get_style_context()->remove_class("persistent");
}
if ((*it)["nodes"].size() == 0) {
if (noNodes) {
button.get_style_context()->add_class("empty");
} else {
button.get_style_context()->remove_class("empty");
Expand Down Expand Up @@ -406,7 +407,7 @@ std::string Workspaces::getIcon(const std::string &name, const Json::Value &node
}
}
if (key == "focused" || key == "urgent") {
if (config_["format-icons"][key].isString() && node[key].asBool()) {
if (config_["format-icons"][key].isString() && hasFlag(node, key)) {
return config_["format-icons"][key].asString();
}
} else if (config_["format-icons"]["persistent"].isString() &&
Expand Down

0 comments on commit 3de9e0c

Please sign in to comment.