diff options
| author | Silarn <jrim@rimpo.org> | 2019-12-06 23:12:18 -0600 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2019-12-06 23:12:18 -0600 |
| commit | b3331ef2c0b50ab2cea4c328e78f6ab58bca099d (patch) | |
| tree | e0be0d00f40733baa4692120d0266ae797ab3785 /src/modconflicticondelegate.h | |
| parent | d42bca5bc0043337f8de72ea72544ebabc505f8b (diff) | |
Separate conflict flags and render them in separate columns
Diffstat (limited to 'src/modconflicticondelegate.h')
| -rw-r--r-- | src/modconflicticondelegate.h | 36 |
1 files changed, 36 insertions, 0 deletions
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<QString> getIconsForFlags( + std::vector<ModInfo::EConflictFlag> flags, bool compact); + + static QString getFlagIcon(ModInfo::EConflictFlag flag); + +public slots: + void columnResized(int logicalIndex, int oldSize, int newSize); + +protected: + virtual QList<QString> 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 |
