diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-03 14:46:39 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-03 14:46:39 +0200 |
| commit | ae8f1015e0ce7c55bf795c4c70c8369a76303588 (patch) | |
| tree | e56f1bc96e2473d29056c0cabc86f846887e3f7c | |
| parent | 5e1671afd96fd3f8f02188d8e238affac5b82a97 (diff) | |
| parent | 3d128f67a4c006d610b449a224b47479fc45d324 (diff) | |
| download | redot-engine-ae8f1015e0ce7c55bf795c4c70c8369a76303588.tar.gz | |
Merge pull request #79064 from MewPurPur/rename-button-pressed-THIS-IS-NOT-A-COMPAT-BREAK
Rename `button_pressed` default signal binding to avoid shadowing
| -rw-r--r-- | doc/classes/BaseButton.xml | 6 | ||||
| -rw-r--r-- | scene/gui/base_button.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index b18ee95a43..c5998ad8a1 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -17,7 +17,7 @@ </method> <method name="_toggled" qualifiers="virtual"> <return type="void" /> - <param index="0" name="button_pressed" type="bool" /> + <param index="0" name="toggled_on" type="bool" /> <description> Called when the button is toggled (only if [member toggle_mode] is active). </description> @@ -98,9 +98,9 @@ </description> </signal> <signal name="toggled"> - <param index="0" name="button_pressed" type="bool" /> + <param index="0" name="toggled_on" type="bool" /> <description> - Emitted when the button was just toggled between pressed and normal states (only if [member toggle_mode] is active). The new state is contained in the [param button_pressed] argument. + Emitted when the button was just toggled between pressed and normal states (only if [member toggle_mode] is active). The new state is contained in the [param toggled_on] argument. </description> </signal> </signals> diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 3ac3ca7363..f57afb66b3 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -468,12 +468,12 @@ void BaseButton::_bind_methods() { ClassDB::bind_method(D_METHOD("get_button_group"), &BaseButton::get_button_group); GDVIRTUAL_BIND(_pressed); - GDVIRTUAL_BIND(_toggled, "button_pressed"); + GDVIRTUAL_BIND(_toggled, "toggled_on"); ADD_SIGNAL(MethodInfo("pressed")); ADD_SIGNAL(MethodInfo("button_up")); ADD_SIGNAL(MethodInfo("button_down")); - ADD_SIGNAL(MethodInfo("toggled", PropertyInfo(Variant::BOOL, "button_pressed"))); + ADD_SIGNAL(MethodInfo("toggled", PropertyInfo(Variant::BOOL, "toggled_on"))); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "toggle_mode"), "set_toggle_mode", "is_toggle_mode"); |
