mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 00:42:14 -07:00
clean up iconPath logic
This commit is contained in:
parent
1d879d303c
commit
473caaae1b
1 changed files with 10 additions and 16 deletions
|
|
@ -252,25 +252,19 @@ QIcon UserLevelPixmapGenerator::generateIconWithColorOverride(int height,
|
||||||
return iconCache.value(key);
|
return iconCache.value(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString iconPath;
|
QString iconType;
|
||||||
if (colorRight.has_value()) {
|
if (isBuddy) {
|
||||||
if (isBuddy) {
|
iconType = "star";
|
||||||
iconPath = "theme:usericons/star_double.svg";
|
} else if (privLevel.toLower() == "vip") {
|
||||||
} else if (privLevel.toLower() == "vip") {
|
iconType = "pawn_vip";
|
||||||
iconPath = "theme:usericons/pawn_vip_double.svg";
|
|
||||||
} else {
|
|
||||||
iconPath = "theme:usericons/pawn_double.svg";
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (isBuddy) {
|
iconType = "pawn";
|
||||||
iconPath = "theme:usericons/star_single.svg";
|
|
||||||
} else if (privLevel.toLower() == "vip") {
|
|
||||||
iconPath = "theme:usericons/pawn_vip_single.svg";
|
|
||||||
} else {
|
|
||||||
iconPath = "theme:usericons/pawn_single.svg";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString arity = colorRight.has_value() ? "double" : "single";
|
||||||
|
|
||||||
|
QString iconPath = QString("theme:usericons/%1_%2.svg").arg(iconType).arg(arity);
|
||||||
|
|
||||||
QIcon icon(changeSVGColor(iconPath, colorLeft.value(), colorRight));
|
QIcon icon(changeSVGColor(iconPath, colorLeft.value(), colorRight));
|
||||||
iconCache.insert(key, icon);
|
iconCache.insert(key, icon);
|
||||||
return icon;
|
return icon;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue