diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index b4322e3155..25de9aa3fe 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -304,7 +304,12 @@ RichMessageDialogBase::RichMessageDialogBase(wxWindow* parent, const HtmlContent m_content = content; // We need a copy for the on_link_clicked lambda. add_msg_content(this, content_sizer, m_content); +#ifdef _WIN32 // See comment in the header where m_checkBox is defined. m_checkBox = new ::CheckBox(this, m_checkBoxText); +#else + m_checkBox = new wxCheckBox(this, wxID_ANY, m_checkBoxText); +#endif + wxGetApp().UpdateDarkUI(m_checkBox); m_checkBox->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent&) { m_checkBoxValue = m_checkBox->GetValue(); }); diff --git a/src/slic3r/GUI/MsgDialog.hpp b/src/slic3r/GUI/MsgDialog.hpp index e568b1f1da..d23c2bca3a 100644 --- a/src/slic3r/GUI/MsgDialog.hpp +++ b/src/slic3r/GUI/MsgDialog.hpp @@ -110,7 +110,17 @@ wxString get_wraped_wxString(const wxString& text_in, size_t line_len = 80); // Generic rich message dialog, used intead of wxRichMessageDialog class RichMessageDialogBase : public MsgDialog { + +// Using CheckBox causes some weird sizer-related issues on Linux and macOS. To get around the problem before +// we find a better fix, we will fallback to wxCheckBox in this dialog. This makes little difference for most dialogs, +// We currently only use this class as a base for HtmlCapableRichMessageDialog on Linux and macOS. The normal +// RichMessageDialog is just an alias for wxRichMessageDialog on these platforms. +#ifdef _WIN32 CheckBox* m_checkBox{ nullptr }; +#else + wxCheckBox* m_checkBox{ nullptr }; +#endif + wxString m_checkBoxText; bool m_checkBoxValue{ false };