diff options
| author | Juan Linietsky <reduzio@gmail.com> | 2016-06-23 18:20:39 -0300 |
|---|---|---|
| committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-23 18:20:39 -0300 |
| commit | 9e0b6057e74181635bf3732879313d3d82bcfd93 (patch) | |
| tree | 05a68650c38185aafb60f8f3fe9e520aa7b485b7 /scene/gui/base_button.cpp | |
| parent | a8f8f52b195f1992ae72e5ea21eb0d4eeaeeaa02 (diff) | |
| download | redot-engine-9e0b6057e74181635bf3732879313d3d82bcfd93.tar.gz | |
Make button aware of it being dragged and reset state, closes #4178
Diffstat (limited to 'scene/gui/base_button.cpp')
| -rw-r--r-- | scene/gui/base_button.cpp | 10 |
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(); } } |
