Skip to content

Commit

Permalink
Merge pull request #965 from ofwinterpassed/master
Browse files Browse the repository at this point in the history
Fixing logic in getIcon
  • Loading branch information
Alexays authored Jan 3, 2021
2 parents 7b7edc9 + f20dbbb commit 1f62082
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ALabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ std::string ALabel::getIcon(uint16_t percentage, const std::string& alt, uint16_
std::string ALabel::getIcon(uint16_t percentage, std::vector<std::string>& alts, uint16_t max) {
auto format_icons = config_["format-icons"];
if (format_icons.isObject()) {
std::string _alt = "default";
for (const auto& alt : alts) {
if (!alt.empty() && (format_icons[alt].isString() || format_icons[alt].isArray())) {
format_icons = format_icons[alt];
_alt = alt;
break;
} else {
format_icons = format_icons["default"];
}
}
format_icons = format_icons[_alt];
}
if (format_icons.isArray()) {
auto size = format_icons.size();
Expand Down

0 comments on commit 1f62082

Please sign in to comment.