diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-01-28 15:35:25 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-01-28 15:35:40 +0100 |
commit | 7c3003fcbedf1eed3dac3ffe8ee740b5cf0efe3a (patch) | |
tree | 9dd0ae12ed6d2c1c6d07094ad9838130fddb1970 /scene/gui/base_button.cpp | |
parent | 38c6611b91f5ee7ded0c2c1d279ab7dcdc4f2f1c (diff) | |
download | redot-engine-7c3003fcbedf1eed3dac3ffe8ee740b5cf0efe3a.tar.gz |
Improve some signal bindings to use specific `Object` subtypes
Diffstat (limited to 'scene/gui/base_button.cpp')
-rw-r--r-- | scene/gui/base_button.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 5f937acb8d..ec451b07cf 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -444,6 +444,7 @@ void BaseButton::_bind_methods() { ADD_SIGNAL(MethodInfo("button_up")); ADD_SIGNAL(MethodInfo("button_down")); ADD_SIGNAL(MethodInfo("toggled", PropertyInfo(Variant::BOOL, "button_pressed"))); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "toggle_mode"), "set_toggle_mode", "is_toggle_mode"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortcut_in_tooltip"), "set_shortcut_in_tooltip", "is_shortcut_in_tooltip_enabled"); @@ -503,7 +504,8 @@ BaseButton *ButtonGroup::get_pressed_button() { void ButtonGroup::_bind_methods() { ClassDB::bind_method(D_METHOD("get_pressed_button"), &ButtonGroup::get_pressed_button); ClassDB::bind_method(D_METHOD("get_buttons"), &ButtonGroup::_get_buttons); - ADD_SIGNAL(MethodInfo("pressed", PropertyInfo(Variant::OBJECT, "button"))); + + ADD_SIGNAL(MethodInfo("pressed", PropertyInfo(Variant::OBJECT, "button", PROPERTY_HINT_RESOURCE_TYPE, "BaseButton"))); } ButtonGroup::ButtonGroup() { |