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:
authorYuSanka <yusanka@gmail.com>2019-04-25 16:06:44 +0300
committerYuSanka <yusanka@gmail.com>2019-04-25 16:09:12 +0300
commit708037158e78dfe0552b3ed5d9498da1832e031b (patch)
tree0400c2bc1421a673f4e1ff599ddad83a40580fd6 /src/slic3r/GUI/Field.cpp
parent3f978f6afe95411ebe25fd8fcb38986b6d8ecbc4 (diff)
Added msw_buttons_rescale() - Function for a scaling Dialog's buttons under MSW
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;