| 224 | } |
| 225 | |
| 226 | bool Workspaces::filterButtons() { |
| 227 | bool needReorder = false; |
| 228 | for (auto it = buttons_.begin(); it != buttons_.end();) { |
| 229 | auto ws = std::find_if(workspaces_.begin(), workspaces_.end(), |
| 230 | [it](const auto& node) { return node["name"].asString() == it->first; }); |
| 231 | if (ws == workspaces_.end() || |
| 232 | (!config_["all-outputs"].asBool() && (*ws)["output"].asString() != bar_.output->name)) { |
| 233 | it = buttons_.erase(it); |
| 234 | needReorder = true; |
| 235 | } else { |
| 236 | ++it; |
| 237 | } |
| 238 | } |
| 239 | return needReorder; |
| 240 | } |
| 241 | |
| 242 | bool Workspaces::hasFlag(const Json::Value& node, const std::string& flag) { |
| 243 | if (node[flag].asBool()) { |