mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -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);
|
||||
}
|
||||
|
||||
QString iconPath;
|
||||
if (colorRight.has_value()) {
|
||||
if (isBuddy) {
|
||||
iconPath = "theme:usericons/star_double.svg";
|
||||
} else if (privLevel.toLower() == "vip") {
|
||||
iconPath = "theme:usericons/pawn_vip_double.svg";
|
||||
} else {
|
||||
iconPath = "theme:usericons/pawn_double.svg";
|
||||
}
|
||||
QString iconType;
|
||||
if (isBuddy) {
|
||||
iconType = "star";
|
||||
} else if (privLevel.toLower() == "vip") {
|
||||
iconType = "pawn_vip";
|
||||
} else {
|
||||
if (isBuddy) {
|
||||
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";
|
||||
}
|
||||
iconType = "pawn";
|
||||
}
|
||||
|
||||
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));
|
||||
iconCache.insert(key, icon);
|
||||
return icon;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue