From 807a84f7c9aac49d2fd1f9c46693e0918f99c553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Mon, 16 Oct 2017 20:53:02 +0200 Subject: Reset slider mouse state on hiding/removing Resetting `grab.active`, but also `mouse_inside` so that after reappearing it must be hovered again -even if the mouse is still over it- in order to get a highlight. That is consistent to the way other controls in the engine, e.g. buttons, work. Fixes #12130. --- scene/gui/slider.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 116e0ac354..e88742a3e3 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -157,6 +157,12 @@ void Slider::_notification(int p_what) { mouse_inside = false; update(); } break; + case NOTIFICATION_VISIBILITY_CHANGED: // fallthrough + case NOTIFICATION_EXIT_TREE: { + + mouse_inside = false; + grab.active = false; + } break; case NOTIFICATION_DRAW: { RID ci = get_canvas_item(); Size2i size = get_size(); -- cgit v1.2.3