summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authoreska <eska@eska.me>2015-09-26 03:06:42 +0200
committereska <eska@eska.me>2015-09-26 03:06:42 +0200
commitce2faae2c512b03a575db1cca0696cbec0469bfa (patch)
tree04bf709de48a9d49eef114b3bf35c1379d66667f /scene/gui
parent52eebdc00185e18ec6fca4d9c96966e0ab0fb495 (diff)
Fix BaseButtons remaining pressed when hiding them while pressing them down
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 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() {