mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 09:59:59 +03:00
Fix library column stretching
This commit is contained in:
parent
8fa69307d2
commit
e558584af0
1 changed files with 15 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue