summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-03 12:01:34 +0200
committerGitHub <noreply@github.com>2020-07-03 12:01:34 +0200
commitad04cf0bfa22a5187c577a9c3af16ada11dd88cd (patch)
tree1d1bee6be5f337cd4dd880ad27bafeb948632640 /scene/gui
parentf0dffa5f1d63ab944e3e6a28e68184773996a721 (diff)
parent8674e5c0bd9bc8842417973994df3383e06f8ec7 (diff)
Merge pull request #32907 from georgikoemdzhiev/FixPressedIssue
Uncheck 'Pressed' if toggle_mode is unchecked
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/base_button.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index d8229b5f43..6fef44481a 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -271,6 +271,11 @@ BaseButton::DrawMode BaseButton::get_draw_mode() const {
}
void BaseButton::set_toggle_mode(bool p_on) {
+ // Make sure to set 'pressed' to false if we are not in toggle mode
+ if (!p_on) {
+ set_pressed(false);
+ }
+
toggle_mode = p_on;
}