Fix mod select dialog size
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
db14db2b73
commit
97189a3a76
|
|
@ -25,9 +25,25 @@ ModSelectDialog::ModSelectDialog(const QStringList& mods, QWidget* parent)
|
|||
first_item->setCheckState(Qt::Checked);
|
||||
|
||||
item_model->appendRow(first_item);
|
||||
item_model->layoutChanged();
|
||||
}
|
||||
|
||||
ui->treeView->expandAll();
|
||||
ui->treeView->resizeColumnToContents(0);
|
||||
|
||||
int rows = item_model->rowCount();
|
||||
int height = ui->treeView->contentsMargins().top() + ui->treeView->contentsMargins().bottom();
|
||||
int width = 0;
|
||||
|
||||
for (int i = 0; i < rows; ++i) {
|
||||
height += ui->treeView->sizeHintForRow(i);
|
||||
width = qMax(width, item_model->item(i)->sizeHint().width());
|
||||
}
|
||||
|
||||
width += ui->treeView->contentsMargins().left() + ui->treeView->contentsMargins().right();
|
||||
ui->treeView->setMinimumHeight(qMin(height, 600));
|
||||
ui->treeView->setMinimumWidth(qMin(width, 700));
|
||||
adjustSize();
|
||||
|
||||
connect(this, &QDialog::accepted, this, [this]() {
|
||||
QStringList selected_mods;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<height>430</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>The specified folder or archive contain the following mods. Select which ones to install.</string>
|
||||
<string>The specified folder or archive contains the following mods. Select which ones to install.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
|
|
|||
Loading…
Reference in New Issue