NOISSUE fix aspect ratio issues with the instance icon in the instance toolbar

This commit is contained in:
Petr Mrázek
2017-09-28 02:47:54 +02:00
parent c51512f940
commit ea71281629
6 changed files with 68 additions and 34 deletions

View File

@ -392,20 +392,6 @@ QIcon IconList::getIcon(const QString &key) const
return QIcon();
}
QIcon IconList::getBigIcon(const QString &key) const
{
int icon_index = getIconIndex(key);
// Fallback for icons that don't exist.
icon_index = getIconIndex(icon_index == -1 ? "infinity" : key);
if (icon_index == -1)
return QIcon();
QPixmap bigone = icons[icon_index].icon().pixmap(256,256).scaled(256,256);
return QIcon(bigone);
}
int IconList::getIconIndex(const QString &key) const
{
auto iter = name_index.find(key == "default" ? "infinity" : key);

View File

@ -38,7 +38,6 @@ public:
virtual ~IconList() {};
QIcon getIcon(const QString &key) const;
QIcon getBigIcon(const QString &key) const;
int getIconIndex(const QString &key) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;