From a096f653ccdba16f1e76857ba14f1e4e6305ec5f Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 8 Feb 2025 09:58:49 +0100 Subject: [PATCH] Inlined set_pressed_no_signal call into BaseButton::set_pressed(). --- scene/gui/base_button.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 9731d2e35..a2428e67e 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -213,12 +213,16 @@ bool BaseButton::is_disabled() const { } void BaseButton::set_pressed(bool p_pressed) { - bool prev_pressed = status.pressed; - set_pressed_no_signal(p_pressed); - - if (status.pressed == prev_pressed) { + if (!toggle_mode) { return; } + + if (status.pressed == p_pressed) { + return; + } + + status.pressed = p_pressed; + _change_notify("pressed"); if (p_pressed) {