diff options
Diffstat (limited to 'src/slic3r/GUI')
-rw-r--r-- | src/slic3r/GUI/MsgDialog.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index a70a9b172..80a8159c0 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -75,8 +75,13 @@ void MsgDialog::SetButtonLabel(wxWindowID btn_id, const wxString& label, bool se wxButton* MsgDialog::add_button(wxWindowID btn_id, bool set_focus /*= false*/, const wxString& label/* = wxString()*/) { wxButton* btn = new wxButton(this, btn_id, label); - if (set_focus) + if (set_focus) { btn->SetFocus(); + // For non-MSW platforms SetFocus is not enought to use it as default, when the dialog is closed by ENTER + // We have to set this button as the (permanently) default one in its dialog + // See https://twitter.com/ZMelmed/status/1472678454168539146 + btn->SetDefault(); + } btn_sizer->Add(btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, HORIZ_SPACING); btn->Bind(wxEVT_BUTTON, [this, btn_id](wxCommandEvent&) { this->EndModal(btn_id); }); return btn; |