summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-02 09:49:17 +0200
committerGitHub <noreply@github.com>2018-10-02 09:49:17 +0200
commit08a24698ebd0383e0e90f58052b4c2d465b9f252 (patch)
tree6db1610b43c4d12d936a1a3db7170808a6796066 /scene
parent0349d6db238274f4b9da20ed028316cc93dabfd2 (diff)
parent1e65916241037d559f27c5d3c81fbf4f5d57884f (diff)
Merge pull request #22062 from Leytak/patch-1
Discard button pressing flags on disable
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/base_button.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 895e76d516..71fb97c2c6 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -315,6 +315,14 @@ void BaseButton::set_disabled(bool p_disabled) {
return;
status.disabled = p_disabled;
+ if (p_disabled) {
+ if (!toggle_mode) {
+ status.pressed = false;
+ }
+ status.press_attempt = false;
+ status.pressing_inside = false;
+ status.pressing_button = 0;
+ }
update();
_change_notify("disabled");
}