summaryrefslogtreecommitdiffstats
path: root/gui/groupview
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-09-06 18:16:56 +0200
committerPetr Mrázek <peterix@gmail.com>2014-09-06 19:03:05 +0200
commit20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c (patch)
tree56bf51e681f2e73590a549499bd83d7b505c39f8 /gui/groupview
parent36efcf8d3c0cbd7823fc65569cfc2b011435db2c (diff)
downloadMultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.tar
MultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.tar.gz
MultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.tar.lz
MultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.tar.xz
MultiMC-20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c.zip
Sync from quickmods
Diffstat (limited to 'gui/groupview')
-rw-r--r--gui/groupview/InstanceDelegate.cpp16
-rw-r--r--gui/groupview/InstanceDelegate.h2
2 files changed, 6 insertions, 12 deletions
diff --git a/gui/groupview/InstanceDelegate.cpp b/gui/groupview/InstanceDelegate.cpp
index 3bd77747..e49e1552 100644
--- a/gui/groupview/InstanceDelegate.cpp
+++ b/gui/groupview/InstanceDelegate.cpp
@@ -113,16 +113,10 @@ void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItemV4 &option
void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseInstance *instance)
{
QList<QString> pixmaps;
- for (auto flag : instance->flags())
+ const BaseInstance::InstanceFlags flags = instance->flags();
+ if (flags & BaseInstance::VersionBrokenFlag)
{
- switch (flag)
- {
- case BaseInstance::VersionBrokenFlag:
- pixmaps.append("broken");
- break;
- default:
- break;
- }
+ pixmaps.append("broken");
}
// begin easter eggs
@@ -160,7 +154,7 @@ void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseIns
{
return;
}
- const QPixmap pixmap = ListViewDelegate::requestPixmap(it.next()).scaled(
+ const QPixmap pixmap = ListViewDelegate::requestBadgePixmap(it.next()).scaled(
itemSide, itemSide, Qt::KeepAspectRatio, Qt::FastTransformation);
painter->drawPixmap(option.rect.width() - x * itemSide + qMax(x - 1, 0) * spacing - itemSide,
y * itemSide + qMax(y - 1, 0) * spacing, itemSide, itemSide,
@@ -354,7 +348,7 @@ QSize ListViewDelegate::sizeHint(const QStyleOptionViewItem &option,
return sz;
}
-QPixmap ListViewDelegate::requestPixmap(const QString &key)
+QPixmap ListViewDelegate::requestBadgePixmap(const QString &key)
{
if (!m_pixmapCache.contains(key))
{
diff --git a/gui/groupview/InstanceDelegate.h b/gui/groupview/InstanceDelegate.h
index 9ab44864..1520cbb8 100644
--- a/gui/groupview/InstanceDelegate.h
+++ b/gui/groupview/InstanceDelegate.h
@@ -23,7 +23,7 @@ class ListViewDelegate : public QStyledItemDelegate
public:
explicit ListViewDelegate(QObject *parent = 0);
- static QPixmap requestPixmap(const QString &key);
+ static QPixmap requestBadgePixmap(const QString &key);
protected:
void paint(QPainter *painter, const QStyleOptionViewItem &option,