Skip to content

Commit

Permalink
Fix random button ordering in PAGE_LOAD
Browse files Browse the repository at this point in the history
Ensure that "Browse..." always has a different role than Ok, otherwise Qt does
fancy things.

Closes #1582.
  • Loading branch information
lmoureaux authored and jwrober committed Dec 17, 2022
1 parent 9539024 commit 0445ce3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions client/page_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ page_load::page_load(QWidget *parent, fc_client *c) : QWidget(parent)
connect(ui.show_preview, &QCheckBox::stateChanged, this,
&page_load::state_preview);

auto browse = ui.buttons->button(QDialogButtonBox::Open);
browse->setText(_("Browse..."));
auto browse =
ui.buttons->addButton(_("Browse..."), QDialogButtonBox::ActionRole);
browse->setIcon(QIcon::fromTheme(QStringLiteral("document-open-folder")));
connect(browse, &QAbstractButton::clicked, this, &page_load::browse_saves);

connect(ui.buttons->button(QDialogButtonBox::Cancel),
Expand Down
2 changes: 1 addition & 1 deletion client/page_load.ui
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<item row="1" column="0">
<widget class="QDialogButtonBox" name="buttons">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Open</set>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down

0 comments on commit 0445ce3

Please sign in to comment.