diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp index 642a866f3..c83c7248b 100644 --- a/src/slic3r/GUI/Field.hpp +++ b/src/slic3r/GUI/Field.hpp @@ -87,6 +87,8 @@ protected: void on_set_focus(wxEvent& event); /// Call the attached on_change method. void on_change_field(); + +public: /// Call the attached m_back_to_initial_value method. void on_back_to_initial_value(); /// Call the attached m_back_to_sys_value method. diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index bbdc6869f..443d6c148 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -39,12 +39,12 @@ OG_CustomCtrl::OG_CustomCtrl( wxWindow* parent, this->Bind(wxEVT_PAINT, &OG_CustomCtrl::OnPaint, this); this->Bind(wxEVT_MOTION, &OG_CustomCtrl::OnMotion, this); this->Bind(wxEVT_LEFT_DOWN, &OG_CustomCtrl::OnLeftDown, this); - this->Bind(wxEVT_LEFT_UP, &OG_CustomCtrl::OnLeftUp, this); } void OG_CustomCtrl::init_ctrl_lines() { - for (const Line& line : opt_group->get_lines()) + const std::vector& og_lines = opt_group->get_lines(); + for (const Line& line : og_lines) { if (line.full_width && ( // description line @@ -64,13 +64,13 @@ void OG_CustomCtrl::init_ctrl_lines() line.get_extra_widgets().size() == 0) { height = m_bmp_blinking_sz.GetHeight() + m_v_gap; - ctrl_lines.emplace_back(CtrlLine{ height, this, line, true }); + ctrl_lines.emplace_back(CtrlLine(height, this, line, true)); } else if (opt_group->label_width != 0 && !line.label.IsEmpty()) { wxSize label_sz = GetTextExtent(line.label); height = label_sz.y * (label_sz.GetWidth() > int(opt_group->label_width * m_em_unit) ? 2 : 1) + m_v_gap; - ctrl_lines.emplace_back(CtrlLine{ height, this, line }); + ctrl_lines.emplace_back(CtrlLine(height, this, line)); } else int i = 0; @@ -106,10 +106,12 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/) if (opt_group->label_width != 0 && !label.IsEmpty()) h_pos += opt_group->label_width * m_em_unit + m_h_gap; - if (line.widget) - break; + int blinking_button_width = m_bmp_blinking_sz.GetWidth() + m_h_gap; - int action_buttons_width = 3 * (m_bmp_blinking_sz.GetWidth() + m_h_gap); + if (line.widget) { + h_pos += blinking_button_width; + break; + } // If we have a single option with no sidetext const std::vector