Merge pull request #2393 from zjeffer/hyprland/fixes

Hyprland/workspaces: use named icons instead of searching by id
pull/2402/head
Alexis Rouillard 2023-08-14 11:46:55 +02:00 committed by GitHub
commit 2c7bbe9852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -324,8 +324,7 @@ void Workspace::update(const std::string &format, const std::string &icon) {
add_or_remove_class(style_context, is_special(), "special");
add_or_remove_class(style_context, is_empty(), "persistent");
label_.set_markup(
fmt::format(fmt::runtime(format), fmt::arg("id", id()),
label_.set_markup(fmt::format(fmt::runtime(format), fmt::arg("id", id()),
fmt::arg("name", name()), fmt::arg("icon", icon)));
}
@ -383,7 +382,7 @@ std::string &Workspace::select_icon(std::map<std::string, std::string> &icons_ma
}
}
auto named_icon_it = icons_map.find(std::to_string(id()));
auto named_icon_it = icons_map.find(name());
if (named_icon_it != icons_map.end()) {
return named_icon_it->second;
}