From f250c0cf5067bf3b032553ac982120e0fcff08bf Mon Sep 17 00:00:00 2001 From: Anthony Fieroni Date: Fri, 7 Oct 2016 16:33:28 +0300 Subject: [PATCH] Button focus hovering Signed-off-by: Anthony Fieroni bvbfan@abv.bg (cherry picked from commit 6d21fd42d3713d8edd51f209e55358e2622aaa3a) --- scene/gui/base_button.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 6479dd2d02a..64d68738b2a 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -243,12 +243,22 @@ void BaseButton::_notification(int p_what) { update(); } } + + if (p_what==NOTIFICATION_FOCUS_ENTER) { + + status.hovering=true; + update(); + } if (p_what==NOTIFICATION_FOCUS_EXIT) { if (status.pressing_button && status.press_attempt) { status.press_attempt=false; status.pressing_button=0; + status.hovering=false; + update(); + } else if (status.hovering) { + status.hovering=false; update(); } }