diff options
Diffstat (limited to 'scene/gui/base_button.cpp')
-rw-r--r-- | scene/gui/base_button.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 552345e4fe..ca2ab8bd2b 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -218,13 +218,12 @@ bool BaseButton::is_disabled() const { } void BaseButton::set_pressed(bool p_pressed) { - if (!toggle_mode) { - return; - } - if (status.pressed == p_pressed) { + bool prev_pressed = status.pressed; + set_pressed_no_signal(p_pressed); + + if (status.pressed == prev_pressed) { return; } - status.pressed = p_pressed; if (p_pressed) { _unpress_group(); @@ -233,8 +232,6 @@ void BaseButton::set_pressed(bool p_pressed) { } } _toggled(status.pressed); - - queue_redraw(); } void BaseButton::set_pressed_no_signal(bool p_pressed) { |