From b3331ef2c0b50ab2cea4c328e78f6ab58bca099d Mon Sep 17 00:00:00 2001 From: Silarn Date: Fri, 6 Dec 2019 23:12:18 -0600 Subject: Separate conflict flags and render them in separate columns --- src/modconflicticondelegate.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/modconflicticondelegate.h (limited to 'src/modconflicticondelegate.h') diff --git a/src/modconflicticondelegate.h b/src/modconflicticondelegate.h new file mode 100644 index 00000000..d36477c6 --- /dev/null +++ b/src/modconflicticondelegate.h @@ -0,0 +1,36 @@ +#ifndef MODCONFLICTICONDELEGATE_H +#define MODCONFLICTICONDELEGATE_H + +#include "icondelegate.h" + +class ModConflictIconDelegate : public IconDelegate +{ + Q_OBJECT; + +public: + explicit ModConflictIconDelegate(QObject *parent = 0, int logicalIndex = -1, int compactSize = 120); + virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + + static QList getIconsForFlags( + std::vector flags, bool compact); + + static QString getFlagIcon(ModInfo::EConflictFlag flag); + +public slots: + void columnResized(int logicalIndex, int oldSize, int newSize); + +protected: + virtual QList getIcons(const QModelIndex &index) const; + virtual size_t getNumIcons(const QModelIndex &index) const; + +private: + static ModInfo::EConflictFlag m_ConflictFlags[4]; + static ModInfo::EConflictFlag m_ArchiveLooseConflictFlags[2]; + static ModInfo::EConflictFlag m_ArchiveConflictFlags[3]; + + int m_LogicalIndex; + int m_CompactSize; + bool m_Compact; +}; + +#endif // MODCONFLICTICONDELEGATE_H -- cgit v1.3.1 From 27c05cebd58ea33e0465b886d47a2dd9d8fc2ddc Mon Sep 17 00:00:00 2001 From: Al Date: Mon, 9 Dec 2019 00:56:10 +0100 Subject: Change compact size for the conflicts column to be shorter since there are less flags here. --- src/mainwindow.cpp | 2 +- src/modconflicticondelegate.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modconflicticondelegate.h') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 274e07c1..8eff26c5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -554,7 +554,7 @@ void MainWindow::setupModList() ModConflictIconDelegate* conflictFlagDelegate = new ModConflictIconDelegate( - ui->modList, ModList::COL_CONFLICTFLAGS, 120); + ui->modList, ModList::COL_CONFLICTFLAGS, 80); connect( ui->modList->header(), SIGNAL(sectionResized(int, int, int)), diff --git a/src/modconflicticondelegate.h b/src/modconflicticondelegate.h index d36477c6..8645da12 100644 --- a/src/modconflicticondelegate.h +++ b/src/modconflicticondelegate.h @@ -8,7 +8,7 @@ class ModConflictIconDelegate : public IconDelegate Q_OBJECT; public: - explicit ModConflictIconDelegate(QObject *parent = 0, int logicalIndex = -1, int compactSize = 120); + explicit ModConflictIconDelegate(QObject *parent = 0, int logicalIndex = -1, int compactSize = 80); virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; static QList getIconsForFlags( -- cgit v1.3.1