mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Add folder dropdown icons to VDS (#5632)
* add svg * update pixmap cache * get icon to work * hide icon when not clickable * use consistent naming * use expandOnly because apparently that leads to higher image quality
This commit is contained in:
parent
4543038fd8
commit
6f5d369416
7 changed files with 82 additions and 8 deletions
|
|
@ -357,6 +357,21 @@ QPixmap LockPixmapGenerator::generatePixmap(int height)
|
|||
|
||||
QMap<int, QPixmap> LockPixmapGenerator::pmCache;
|
||||
|
||||
QPixmap DropdownIconPixmapGenerator::generatePixmap(int height, bool expanded)
|
||||
{
|
||||
QString key = QString::number(expanded) + ":" + QString::number(height);
|
||||
if (pmCache.contains(key))
|
||||
return pmCache.value(key);
|
||||
|
||||
QString name = expanded ? "dropdown_expanded" : "dropdown_collapsed";
|
||||
QPixmap pixmap = tryLoadImage("theme:icons/" + name, QSize(height, height), true);
|
||||
|
||||
pmCache.insert(key, pixmap);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
QMap<QString, QPixmap> DropdownIconPixmapGenerator::pmCache;
|
||||
|
||||
QPixmap loadColorAdjustedPixmap(const QString &name)
|
||||
{
|
||||
if (qApp->palette().windowText().color().lightness() > 200) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue