Merge pull request #4994 from GlassyBridge/master
feat (hyprland/workspaces): support for state specific icon overrides
This commit is contained in:
@@ -298,6 +298,11 @@ bool Workspace::onWindowOpened(WindowCreationPayload const& create_window_payloa
|
|||||||
std::string& Workspace::selectIcon(std::map<std::string, std::string>& icons_map) {
|
std::string& Workspace::selectIcon(std::map<std::string, std::string>& icons_map) {
|
||||||
spdlog::trace("Selecting icon for workspace {}", name());
|
spdlog::trace("Selecting icon for workspace {}", name());
|
||||||
if (isUrgent()) {
|
if (isUrgent()) {
|
||||||
|
auto urgentNamedIconIt = icons_map.find("urgent:" + name());
|
||||||
|
if (urgentNamedIconIt != icons_map.end()) {
|
||||||
|
return urgentNamedIconIt->second;
|
||||||
|
}
|
||||||
|
|
||||||
auto urgentIconIt = icons_map.find("urgent");
|
auto urgentIconIt = icons_map.find("urgent");
|
||||||
if (urgentIconIt != icons_map.end()) {
|
if (urgentIconIt != icons_map.end()) {
|
||||||
return urgentIconIt->second;
|
return urgentIconIt->second;
|
||||||
@@ -316,6 +321,11 @@ std::string& Workspace::selectIcon(std::map<std::string, std::string>& icons_map
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isActive()) {
|
if (isActive()) {
|
||||||
|
auto activeNamedIconIt = icons_map.find("active:" + name());
|
||||||
|
if (activeNamedIconIt != icons_map.end()) {
|
||||||
|
return activeNamedIconIt->second;
|
||||||
|
}
|
||||||
|
|
||||||
auto activeIconIt = icons_map.find("active");
|
auto activeIconIt = icons_map.find("active");
|
||||||
if (activeIconIt != icons_map.end()) {
|
if (activeIconIt != icons_map.end()) {
|
||||||
return activeIconIt->second;
|
return activeIconIt->second;
|
||||||
@@ -323,6 +333,11 @@ std::string& Workspace::selectIcon(std::map<std::string, std::string>& icons_map
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isSpecial()) {
|
if (isSpecial()) {
|
||||||
|
auto specialNamedIconIt = icons_map.find("special:" + name());
|
||||||
|
if (specialNamedIconIt != icons_map.end()) {
|
||||||
|
return specialNamedIconIt->second;
|
||||||
|
}
|
||||||
|
|
||||||
auto specialIconIt = icons_map.find("special");
|
auto specialIconIt = icons_map.find("special");
|
||||||
if (specialIconIt != icons_map.end()) {
|
if (specialIconIt != icons_map.end()) {
|
||||||
return specialIconIt->second;
|
return specialIconIt->second;
|
||||||
|
|||||||
Reference in New Issue
Block a user