Focus the "make DCP/OK" button in the hints dialog (#2539).
authorCarl Hetherington <cth@carlh.net>
Mon, 29 May 2023 20:47:48 +0000 (22:47 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 29 May 2023 20:47:48 +0000 (22:47 +0200)
src/wx/hints_dialog.cc

index 7a44e22676b0305578052d4e1d287ed5b08f6376..72a57740e4f2d024dede4d96608a0174a868a8d5 100644 (file)
@@ -69,15 +69,20 @@ HintsDialog::HintsDialog (wxWindow* parent, std::weak_ptr<Film> film, bool ok)
 
        auto buttons = CreateStdDialogButtonSizer (0);
        sizer->Add (CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder());
 
        auto buttons = CreateStdDialogButtonSizer (0);
        sizer->Add (CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder());
+       wxButton* default_button = nullptr;
        if (ok) {
        if (ok) {
-               buttons->SetAffirmativeButton (new wxButton (this, wxID_OK));
+               default_button = new wxButton(this, wxID_OK);
+               buttons->SetAffirmativeButton(default_button);
        } else {
        } 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 ();
 
                buttons->SetNegativeButton (new wxButton (this, wxID_CANCEL, _("Go back")));
        }
 
        buttons->Realize ();
 
+       default_button->SetFocus();
+
        SetSizer (sizer);
        sizer->Layout ();
        sizer->SetSizeHints (this);
        SetSizer (sizer);
        sizer->Layout ();
        sizer->SetSizeHints (this);