summaryrefslogtreecommitdiffstats
path: root/logic/icons
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-01-20 01:32:38 +0100
committerPetr Mrázek <peterix@gmail.com>2014-01-20 01:32:38 +0100
commit222d3c0dc5a8b8a9e93b9368e964cda7becc7f02 (patch)
tree9ab4538f2e80847874a7c9a5c7c2dbc099cb8cae /logic/icons
parent48b587e7b6b96b5c3ac17dc8b67a7b0ab9c2c4f0 (diff)
parent3a3c9ac9515447941d383f2c4fe4b0225fdd8252 (diff)
downloadMultiMC-222d3c0dc5a8b8a9e93b9368e964cda7becc7f02.tar
MultiMC-222d3c0dc5a8b8a9e93b9368e964cda7becc7f02.tar.gz
MultiMC-222d3c0dc5a8b8a9e93b9368e964cda7becc7f02.tar.lz
MultiMC-222d3c0dc5a8b8a9e93b9368e964cda7becc7f02.tar.xz
MultiMC-222d3c0dc5a8b8a9e93b9368e964cda7becc7f02.zip
Merge branch 'release-0.2'0.2
Diffstat (limited to 'logic/icons')
-rw-r--r--logic/icons/IconList.cpp17
-rw-r--r--logic/icons/IconList.h1
2 files changed, 18 insertions, 0 deletions
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;