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:
-rw-r--r--src/slic3r/GUI/Field.cpp2
-rw-r--r--src/slic3r/GUI/Field.hpp3
-rw-r--r--src/slic3r/GUI/GUI_ObjectManipulation.cpp16
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;