From 3a3c9ac9515447941d383f2c4fe4b0225fdd8252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 20 Jan 2014 01:14:11 +0100 Subject: Update the changelog, version, scale the instance icon --- logic/icons/IconList.cpp | 17 +++++++++++++++++ logic/icons/IconList.h | 1 + 2 files changed, 18 insertions(+) (limited to 'logic/icons') diff --git a/logic/icons/IconList.cpp b/logic/icons/IconList.cpp index cda2db7b..d76e6fbb 100644 --- a/logic/icons/IconList.cpp +++ b/logic/icons/IconList.cpp @@ -336,6 +336,23 @@ QIcon IconList::getIcon(QString key) return QIcon(); } +QIcon IconList::getBigIcon(QString key) +{ + int icon_index = getIconIndex(key); + + if (icon_index == -1) + key = "infinity"; + + // Fallback for icons that don't exist. + icon_index = getIconIndex(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(QString key) { if (key == "default") diff --git a/logic/icons/IconList.h b/logic/icons/IconList.h index 322411d1..4ee3f782 100644 --- a/logic/icons/IconList.h +++ b/logic/icons/IconList.h @@ -34,6 +34,7 @@ public: virtual ~IconList() {}; QIcon getIcon(QString key); + QIcon getBigIcon(QString key); int getIconIndex(QString key); virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; -- cgit v1.2.3