summaryrefslogtreecommitdiffstats
path: root/gui/widgets/ModListView.cpp
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2014-01-05 00:14:10 +0000
committerSky <git@bunnies.cc>2014-01-05 00:14:10 +0000
commit7d5fb1e99be24a884a69f3cf521aee8e310e2a6e (patch)
tree51d25c7f760eef471de31bf5b1a1e563e87def3c /gui/widgets/ModListView.cpp
parent79158144df1b606982bfa722447416c9549de860 (diff)
parente558584af0e6a168d76868e89d132aeebd0aa36a (diff)
downloadMultiMC-7d5fb1e99be24a884a69f3cf521aee8e310e2a6e.tar
MultiMC-7d5fb1e99be24a884a69f3cf521aee8e310e2a6e.tar.gz
MultiMC-7d5fb1e99be24a884a69f3cf521aee8e310e2a6e.tar.lz
MultiMC-7d5fb1e99be24a884a69f3cf521aee8e310e2a6e.tar.xz
MultiMC-7d5fb1e99be24a884a69f3cf521aee8e310e2a6e.zip
Merge branch 'develop' of github.com:MultiMC/MultiMC5 into develop
Diffstat (limited to 'gui/widgets/ModListView.cpp')
-rw-r--r--gui/widgets/ModListView.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/gui/widgets/ModListView.cpp b/gui/widgets/ModListView.cpp
index 9d5950c3..358e6331 100644
--- a/gui/widgets/ModListView.cpp
+++ b/gui/widgets/ModListView.cpp
@@ -44,9 +44,19 @@ void ModListView::setModel ( QAbstractItemModel* model )
QTreeView::setModel ( model );
auto head = header();
head->setStretchLastSection(false);
- head->setSectionResizeMode(0, QHeaderView::ResizeToContents);
- head->setSectionResizeMode(1, QHeaderView::Stretch);
- for(int i = 2; i < head->count(); i++)
- head->setSectionResizeMode(i, QHeaderView::ResizeToContents);
- dropIndicatorPosition();
+ // HACK: this is true for the checkbox column of mod lists
+ auto string = model->headerData(0,head->orientation()).toString();
+ if(!string.size())
+ {
+ head->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+ head->setSectionResizeMode(1, QHeaderView::Stretch);
+ for(int i = 2; i < head->count(); i++)
+ head->setSectionResizeMode(i, QHeaderView::ResizeToContents);
+ }
+ else
+ {
+ head->setSectionResizeMode(0, QHeaderView::Stretch);
+ for(int i = 1; i < head->count(); i++)
+ head->setSectionResizeMode(i, QHeaderView::ResizeToContents);
+ }
}