diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-10-02 09:49:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 09:49:17 +0200 |
commit | 08a24698ebd0383e0e90f58052b4c2d465b9f252 (patch) | |
tree | 6db1610b43c4d12d936a1a3db7170808a6796066 /scene | |
parent | 0349d6db238274f4b9da20ed028316cc93dabfd2 (diff) | |
parent | 1e65916241037d559f27c5d3c81fbf4f5d57884f (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.cpp | 8 |
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"); } |