summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-09-26 00:53:38 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-09-26 00:53:38 -0300
commit6f0df4e80c42c111d60f8662a267ce4a704ecebc (patch)
tree464ccc8ec67264d6c065eac295eecb5c5b386326 /scene
parent875eb7fe514058d010be258d61e1ce6faa1b4ffd (diff)
parent6ee2a84e8aaea03ff5007526ae8c597d14a5274b (diff)
Merge pull request #2534 from eska014/unpress-hidden-buttons
Fix BaseButtons remaining pressed when hiding while pressed down
Diffstat (limited to 'scene')
-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 965e7f399d..0c63a3bc74 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -255,6 +255,16 @@ void BaseButton::_notification(int p_what) {
group->_remove_button(this);
}
+ if (p_what==NOTIFICATION_VISIBILITY_CHANGED && !is_visible()) {
+
+ if (!toggle_mode) {
+ status.pressed = false;
+ }
+ status.hovering = false;
+ status.press_attempt = false;
+ status.pressing_inside = false;
+ status.pressing_button = 0;
+ }
}
void BaseButton::pressed() {