mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 22:05:53 +08:00
New CheckBox: Set image margin for checkbox with a label
+ RichMessageDialog: Call update of the checkbox, when label is set.[Fix for SPE-2035]
This commit is contained in:
parent
33cd9b9dbe
commit
2e07572498
@ -301,8 +301,10 @@ int RichMessageDialog::ShowModal()
|
||||
{
|
||||
if (m_checkBoxText.IsEmpty())
|
||||
m_checkBox->Hide();
|
||||
else
|
||||
else {
|
||||
m_checkBox->SetLabelText(m_checkBoxText);
|
||||
m_checkBox->Update();
|
||||
}
|
||||
Layout();
|
||||
|
||||
return wxDialog::ShowModal();
|
||||
|
@ -4,8 +4,9 @@
|
||||
|
||||
BitmapToggleButton::BitmapToggleButton(wxWindow* parent, const wxString& label, wxWindowID id)
|
||||
{
|
||||
const long style = wxBORDER_NONE | wxBU_EXACTFIT | wxBU_LEFT;
|
||||
if (label.IsEmpty())
|
||||
wxBitmapToggleButton::Create(parent, id, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxBU_EXACTFIT);
|
||||
wxBitmapToggleButton::Create(parent, id, wxNullBitmap, wxDefaultPosition, wxDefaultSize, style);
|
||||
else {
|
||||
#ifdef __linux__
|
||||
wxSize label_size = parent->GetTextExtent(label);
|
||||
@ -14,7 +15,7 @@ BitmapToggleButton::BitmapToggleButton(wxWindow* parent, const wxString& label,
|
||||
wxSize def_size = wxDefaultSize;
|
||||
#endif
|
||||
// Call Create() from wxToggleButton instead of wxBitmapToggleButton to allow add Label text under Linux
|
||||
wxToggleButton::Create(parent, id, label, wxDefaultPosition, def_size, wxBORDER_NONE | wxBU_EXACTFIT);
|
||||
wxToggleButton::Create(parent, id, label, wxDefaultPosition, def_size, style);
|
||||
}
|
||||
|
||||
#ifdef __WXMSW__
|
||||
|
@ -54,6 +54,8 @@ void CheckBox::update()
|
||||
updateBitmap(e);
|
||||
#endif
|
||||
|
||||
if (GetBitmapMargins().GetWidth() == 0 && !GetLabelText().IsEmpty())
|
||||
SetBitmapMargins(4, 0);
|
||||
update_size();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user