summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-23 18:20:39 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-23 18:20:39 -0300
commit9e0b6057e74181635bf3732879313d3d82bcfd93 (patch)
tree05a68650c38185aafb60f8f3fe9e520aa7b485b7 /scene/gui
parenta8f8f52b195f1992ae72e5ea21eb0d4eeaeeaa02 (diff)
Make button aware of it being dragged and reset state, closes #4178
Diffstat (limited to 'scene/gui')
-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 bc498f47bc..d7632b14b8 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -225,11 +225,21 @@ void BaseButton::_notification(int p_what) {
status.hovering=false;
update();
}
+ if (p_what==NOTIFICATION_DRAG_BEGIN) {
+
+ if (status.press_attempt) {
+ status.press_attempt=false;
+ status.pressing_button=0;
+ update();
+ }
+ }
+
if (p_what==NOTIFICATION_FOCUS_EXIT) {
if (status.pressing_button && status.press_attempt) {
status.press_attempt=false;
status.pressing_button=0;
+ update();
}
}