diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-05-06 16:24:50 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-05-09 12:43:28 +0300 |
commit | cc98c9bbe2931201f4e5f2eb1c243d299ffdc36a (patch) | |
tree | ae9eddad003701114663a71d104c2bc3f779024a /src | |
parent | ec57a7f9711d6e8293c4e181046c9ff6c3e51e8b (diff) |
Fixed disappearing visual hints when the user presses the ENTER key while editing one of the object manipulators fields
Diffstat (limited to 'src')
-rw-r--r-- | src/slic3r/GUI/Field.cpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/Field.hpp | 3 | ||||
-rw-r--r-- | src/slic3r/GUI/GUI_ObjectManipulation.cpp | 16 |
3 files changed, 17 insertions, 4 deletions
diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 5e06efa29..2f4881483 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -260,8 +260,8 @@ void TextCtrl::BUILD() { e.Skip(); temp->GetToolTip()->Enable(true); #endif // __WXGTK__ - propagate_value(); bEnterPressed = true; + propagate_value(); }), temp->GetId()); } diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp index 88ea39036..210ae73f4 100644 --- a/src/slic3r/GUI/Field.hpp +++ b/src/slic3r/GUI/Field.hpp @@ -225,6 +225,9 @@ public: m_em_unit = em_unit(m_parent); } + bool get_enter_pressed() const { return bEnterPressed; } + void set_enter_pressed(bool pressed) { bEnterPressed = pressed; } + protected: RevertButton* m_Undo_btn = nullptr; // Bitmap and Tooltip text for m_Undo_btn. The wxButton will be updated only if the new wxBitmap pointer differs from the currently rendered one. diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp index 5c534a3e1..6c7e4df98 100644 --- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp +++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp @@ -527,11 +527,21 @@ void ObjectManipulation::do_scale(int axis, const Vec3d &scale) const void ObjectManipulation::on_change(t_config_option_key opt_key, const boost::any& value) { - // needed to hide the visual hints in 3D scene - wxGetApp().plater()->canvas3D()->handle_sidebar_focus_event(opt_key, false); + Field* field = m_og->get_field(opt_key); + bool enter_pressed = (field != nullptr) && field->get_enter_pressed(); + if (!enter_pressed) + { + // if the change does not come from the user pressing the ENTER key + // we need to hide the visual hints in 3D scene + wxGetApp().plater()->canvas3D()->handle_sidebar_focus_event(opt_key, false); + #ifndef __APPLE__ - m_focused_option = ""; + m_focused_option = ""; #endif // __APPLE__ + } + else + // if the change comes from the user pressing the ENTER key, restore the key state + field->set_enter_pressed(false); if (!m_cache.is_valid()) return; |