summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-30 11:05:09 +0200
committerGitHub <noreply@github.com>2019-04-30 11:05:09 +0200
commit4f10a08d1bc93c4fc81e4ebc7293c5a748e03424 (patch)
tree15db2872377e65d37751752dbe718e573ea249dc /scene/gui
parent6e1b8b07b93e30ac09175cfcc7001d3aba5685cf (diff)
parentc7fbc63cc23dc1f62e92dca3abab477f425d22e3 (diff)
Merge pull request #27796 from Leytak/patch-2
Reset button state on exit tree
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/base_button.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index d68cdd5f8d..f808d6c234 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -282,10 +282,7 @@ void BaseButton::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
}
- if (p_what == NOTIFICATION_EXIT_TREE) {
- }
-
- if (p_what == NOTIFICATION_VISIBILITY_CHANGED && !is_visible_in_tree()) {
+ if (p_what == NOTIFICATION_EXIT_TREE || (p_what == NOTIFICATION_VISIBILITY_CHANGED && !is_visible_in_tree())) {
if (!toggle_mode) {
status.pressed = false;