aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Fieroni2016-10-07 16:33:28 +0300
committerRémi Verschelde2016-10-17 20:43:36 +0200
commitf250c0cf5067bf3b032553ac982120e0fcff08bf (patch)
tree2ed2cee3dbffa41df33479307c5ca6720d933afb
parent55a5631986c5d7dbb42e36a25d8c921e41f16ff6 (diff)
downloadgodot-f250c0cf5067bf3b032553ac982120e0fcff08bf.tar.gz
godot-f250c0cf5067bf3b032553ac982120e0fcff08bf.tar.zst
godot-f250c0cf5067bf3b032553ac982120e0fcff08bf.zip
Button focus hovering
Signed-off-by: Anthony Fieroni bvbfan@abv.bg (cherry picked from commit 6d21fd42d3713d8edd51f209e55358e2622aaa3a)
-rw-r--r--scene/gui/base_button.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 6479dd2d0..64d68738b 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();
}
}