diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-01-03 23:26:21 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-01-04 23:45:20 +0100 |
commit | e558584af0e6a168d76868e89d132aeebd0aa36a (patch) | |
tree | a1c65f50bdbd6421c180464b6dea325a33280199 /gui/widgets | |
parent | 8fa69307d2d6fb19d157c134691834fc72659ebe (diff) | |
download | MultiMC-e558584af0e6a168d76868e89d132aeebd0aa36a.tar MultiMC-e558584af0e6a168d76868e89d132aeebd0aa36a.tar.gz MultiMC-e558584af0e6a168d76868e89d132aeebd0aa36a.tar.lz MultiMC-e558584af0e6a168d76868e89d132aeebd0aa36a.tar.xz MultiMC-e558584af0e6a168d76868e89d132aeebd0aa36a.zip |
Fix library column stretching
Diffstat (limited to 'gui/widgets')
-rw-r--r-- | gui/widgets/ModListView.cpp | 20 |
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); + } } |