mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 20:12:02 +08:00
An attempt to fix weird sizer-related checkbox issues on Linux and macOS
This commit is contained in:
parent
fd15c8cca5
commit
65610036d6
@ -304,7 +304,12 @@ RichMessageDialogBase::RichMessageDialogBase(wxWindow* parent, const HtmlContent
|
|||||||
m_content = content; // We need a copy for the on_link_clicked lambda.
|
m_content = content; // We need a copy for the on_link_clicked lambda.
|
||||||
add_msg_content(this, content_sizer, m_content);
|
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);
|
m_checkBox = new ::CheckBox(this, m_checkBoxText);
|
||||||
|
#else
|
||||||
|
m_checkBox = new wxCheckBox(this, wxID_ANY, m_checkBoxText);
|
||||||
|
#endif
|
||||||
|
|
||||||
wxGetApp().UpdateDarkUI(m_checkBox);
|
wxGetApp().UpdateDarkUI(m_checkBox);
|
||||||
m_checkBox->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent&) { m_checkBoxValue = m_checkBox->GetValue(); });
|
m_checkBox->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent&) { m_checkBoxValue = m_checkBox->GetValue(); });
|
||||||
|
|
||||||
|
@ -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
|
// Generic rich message dialog, used intead of wxRichMessageDialog
|
||||||
class RichMessageDialogBase : public MsgDialog
|
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 };
|
CheckBox* m_checkBox{ nullptr };
|
||||||
|
#else
|
||||||
|
wxCheckBox* m_checkBox{ nullptr };
|
||||||
|
#endif
|
||||||
|
|
||||||
wxString m_checkBoxText;
|
wxString m_checkBoxText;
|
||||||
bool m_checkBoxValue{ false };
|
bool m_checkBoxValue{ false };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user