Browse Source

Fix mod select dialog size

Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3472/head
crueter 2 days ago
parent
commit
97189a3a76
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 18
      src/yuzu/configuration/addon/mod_select_dialog.cpp
  2. 4
      src/yuzu/configuration/addon/mod_select_dialog.ui

18
src/yuzu/configuration/addon/mod_select_dialog.cpp

@ -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;

4
src/yuzu/configuration/addon/mod_select_dialog.ui

@ -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…
Cancel
Save