summaryrefslogtreecommitdiffstats
path: root/editor/input_event_configuration_dialog.cpp
diff options
context:
space:
mode:
authorRobert Yevdokimov <robert.yevdokimov@autStand.com>2024-02-02 09:03:38 -0500
committerRobert Yevdokimov <robert.yevdokimov@autStand.com>2024-02-02 09:03:38 -0500
commit690fd153567e176251068ddac2aa02ce270c1473 (patch)
treed4aae9a3d201f5d002f90988cc4d929e25e6d37e /editor/input_event_configuration_dialog.cpp
parent10e111477db68fe65776a1d68fb1ffccaf6520fc (diff)
downloadredot-engine-690fd153567e176251068ddac2aa02ce270c1473.tar.gz
Remove unnecessary focus methods and directly bind to 'set_close_on_escape'
Diffstat (limited to 'editor/input_event_configuration_dialog.cpp')
-rw-r--r--editor/input_event_configuration_dialog.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/editor/input_event_configuration_dialog.cpp b/editor/input_event_configuration_dialog.cpp
index 22673bec64..451829163c 100644
--- a/editor/input_event_configuration_dialog.cpp
+++ b/editor/input_event_configuration_dialog.cpp
@@ -263,14 +263,6 @@ void InputEventConfigurationDialog::_on_listen_input_changed(const Ref<InputEven
_set_event(received_event, received_original_event);
}
-void InputEventConfigurationDialog::_on_listen_focus_changed() {
- if (event_listener->has_focus()) {
- set_close_on_escape(false);
- } else {
- set_close_on_escape(true);
- }
-}
-
void InputEventConfigurationDialog::_search_term_updated(const String &) {
_update_input_list();
}
@@ -656,8 +648,8 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() {
event_listener->set_h_size_flags(Control::SIZE_EXPAND_FILL);
event_listener->set_stretch_ratio(0.75);
event_listener->connect("event_changed", callable_mp(this, &InputEventConfigurationDialog::_on_listen_input_changed));
- event_listener->connect("focus_entered", callable_mp(this, &InputEventConfigurationDialog::_on_listen_focus_changed));
- event_listener->connect("focus_exited", callable_mp(this, &InputEventConfigurationDialog::_on_listen_focus_changed));
+ event_listener->connect("focus_entered", callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(false));
+ event_listener->connect("focus_exited", callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(true));
main_vbox->add_child(event_listener);
main_vbox->add_child(memnew(HSeparator));