mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Fix logical errors, formatting error
This commit is contained in:
parent
86b3e456e1
commit
ce2ede70f2
@ -100,7 +100,7 @@ void Workspaces::onEvent(const std::string &ev) {
|
|||||||
for (Json::Value workspace_json : workspaces_json) {
|
for (Json::Value workspace_json : workspaces_json) {
|
||||||
if (workspace_json["name"].asString() == payload &&
|
if (workspace_json["name"].asString() == payload &&
|
||||||
(all_outputs() || bar_.output->name == workspace_json["monitor"].asString()) &&
|
(all_outputs() || bar_.output->name == workspace_json["monitor"].asString()) &&
|
||||||
(show_special() || workspace_json["name"].asString().starts_with("special"))) {
|
(show_special() || !workspace_json["name"].asString().starts_with("special"))) {
|
||||||
workspaces_to_create_.push_back(workspace_json);
|
workspaces_to_create_.push_back(workspace_json);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ void Workspaces::init() {
|
|||||||
const Json::Value workspaces_json = gIPC->getSocket1JsonReply("workspaces");
|
const Json::Value workspaces_json = gIPC->getSocket1JsonReply("workspaces");
|
||||||
for (Json::Value workspace_json : workspaces_json) {
|
for (Json::Value workspace_json : workspaces_json) {
|
||||||
if ((all_outputs() || bar_.output->name == workspace_json["monitor"].asString()) &&
|
if ((all_outputs() || bar_.output->name == workspace_json["monitor"].asString()) &&
|
||||||
(workspace_json["name"].asString().starts_with("special") || show_special()))
|
(!workspace_json["name"].asString().starts_with("special") || show_special()))
|
||||||
create_workspace(workspace_json);
|
create_workspace(workspace_json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +325,8 @@ void Workspace::update(const std::string &format, const std::string &icon) {
|
|||||||
add_or_remove_class(style_context, is_empty(), "persistent");
|
add_or_remove_class(style_context, is_empty(), "persistent");
|
||||||
|
|
||||||
label_.set_markup(
|
label_.set_markup(
|
||||||
fmt::format(fmt::runtime(format), fmt::arg("name", name()), fmt::arg("icon", icon)));
|
fmt::format(fmt::runtime(format), fmt::arg("id", id()),
|
||||||
|
fmt::arg("name", name()), fmt::arg("icon", icon)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspaces::sort_workspaces() {
|
void Workspaces::sort_workspaces() {
|
||||||
|
Loading…
Reference in New Issue
Block a user