summaryrefslogtreecommitdiff
path: root/src/modflagicondelegate.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-07-21 19:14:24 +0200
committerTannin <devnull@localhost>2014-07-21 19:14:24 +0200
commit0050cb07409d775efe14e728c1cef4a2c33aa1db (patch)
treeed3eb9363aa35617f0dd92c4746bf14e032d010f /src/modflagicondelegate.cpp
parentf6ef5477e718b14af99bd22436f66dee0b9d22cd (diff)
- download-list will no longer show a file as having incomplete data if there is no file version
- added a new mod column with icons displaying the content of the mod - MO now differentiates between mods using an internal name that disambiguates between foreign and regular mods
Diffstat (limited to 'src/modflagicondelegate.cpp')
-rw-r--r--src/modflagicondelegate.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modflagicondelegate.cpp b/src/modflagicondelegate.cpp
index 914503a1..96b2bd58 100644
--- a/src/modflagicondelegate.cpp
+++ b/src/modflagicondelegate.cpp
@@ -68,3 +68,20 @@ size_t ModFlagIconDelegate::getNumIcons(const QModelIndex &index) const
}
}
+
+QSize ModFlagIconDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &modelIndex) const
+{
+ int count = getNumIcons(modelIndex);
+ unsigned int index = modelIndex.data(Qt::UserRole + 1).toInt();
+ QSize result;
+ if (index < ModInfo::getNumMods()) {
+ result = QSize(count * 40, 20);
+ } else {
+ result = QSize(1, 20);
+ }
+ if (option.rect.width() > 0) {
+ result.setWidth(std::min(option.rect.width(), result.width()));
+ }
+ return result;
+}
+