Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/slic3r/GUI/Field.cpp')
-rw-r--r--src/slic3r/GUI/Field.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp
index 822361c5d..738ec2e00 100644
--- a/src/slic3r/GUI/Field.cpp
+++ b/src/slic3r/GUI/Field.cpp
@@ -379,8 +379,8 @@ void TextCtrl::change_field_value(wxEvent& event)
void CheckBox::BUILD() {
auto size = wxSize(wxDefaultSize);
- if (m_opt.height >= 0) size.SetHeight(m_opt.height);
- if (m_opt.width >= 0) size.SetWidth(m_opt.width);
+ if (m_opt.height >= 0) size.SetHeight(m_opt.height*m_em_unit);
+ if (m_opt.width >= 0) size.SetWidth(m_opt.width*m_em_unit);
bool check_value = m_opt.type == coBool ?
m_opt.default_value->getBool() : m_opt.type == coBools ?
@@ -413,6 +413,14 @@ boost::any& CheckBox::get_value()
return m_value;
}
+void CheckBox::msw_rescale()
+{
+ Field::msw_rescale();
+
+ wxCheckBox* field = dynamic_cast<wxCheckBox*>(window);
+ field->SetMinSize(wxSize(-1, int(1.5f*field->GetFont().GetPixelSize().y +0.5f)));
+}
+
int undef_spin_val = -9999; //! Probably, It's not necessary
void SpinCtrl::BUILD() {
@@ -849,9 +857,11 @@ void Choice::msw_rescale()
*/
field->Clear();
wxSize size(wxDefaultSize);
- if (m_opt.height >= 0) size.SetHeight(m_opt.height * m_em_unit);
size.SetWidth((m_opt.width > 0 ? m_opt.width : m_width) * m_em_unit);
-
+
+ // Set rescaled min height to correct layout
+ field->SetMinSize(wxSize(-1, int(1.5f*field->GetFont().GetPixelSize().y + 0.5f)));
+ // Set rescaled size
field->SetSize(size);
size_t idx, counter = idx = 0;