From 4493f23618adee7901c297ed6402611205a1cce4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 29 May 2023 22:47:48 +0200 Subject: [PATCH] Focus the "make DCP/OK" button in the hints dialog (#2539). --- src/wx/hints_dialog.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc index 7a44e2267..72a57740e 100644 --- a/src/wx/hints_dialog.cc +++ b/src/wx/hints_dialog.cc @@ -69,15 +69,20 @@ HintsDialog::HintsDialog (wxWindow* parent, std::weak_ptr film, bool ok) auto buttons = CreateStdDialogButtonSizer (0); sizer->Add (CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder()); + wxButton* default_button = nullptr; if (ok) { - buttons->SetAffirmativeButton (new wxButton (this, wxID_OK)); + default_button = new wxButton(this, wxID_OK); + buttons->SetAffirmativeButton(default_button); } else { - buttons->SetAffirmativeButton (new wxButton (this, wxID_OK, _("Make DCP"))); + default_button = new wxButton(this, wxID_OK, _("Make DCP")); + buttons->SetAffirmativeButton(default_button); buttons->SetNegativeButton (new wxButton (this, wxID_CANCEL, _("Go back"))); } buttons->Realize (); + default_button->SetFocus(); + SetSizer (sizer); sizer->Layout (); sizer->SetSizeHints (this); -- 2.30.2