Fixed disappearing visual hints when the user presses the ENTER key while editing one of the object manipulators fields

This commit is contained in:
Enrico Turri 2019-05-06 15:24:50 +02:00
parent ec57a7f971
commit cc98c9bbe2
3 changed files with 17 additions and 4 deletions

View File

@ -260,8 +260,8 @@ void TextCtrl::BUILD() {
e.Skip();
temp->GetToolTip()->Enable(true);
#endif // __WXGTK__
propagate_value();
bEnterPressed = true;
propagate_value();
}), temp->GetId());
}

View File

@ -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.

View File

@ -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
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 = "";
#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;