Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary focus methods and directly bind to set_close_on_escape #87870

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions editor/input_event_configuration_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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));
Expand Down
1 change: 0 additions & 1 deletion editor/input_event_configuration_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class InputEventConfigurationDialog : public ConfirmationDialog {

void _set_event(const Ref<InputEvent> &p_event, const Ref<InputEvent> &p_original_event, bool p_update_input_list_selection = true);
void _on_listen_input_changed(const Ref<InputEvent> &p_event);
void _on_listen_focus_changed();

void _search_term_updated(const String &p_term);
void _update_input_list();
Expand Down
12 changes: 2 additions & 10 deletions editor/project_settings_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,6 @@ void ProjectSettingsEditor::_update_theme() {
}
}

void ProjectSettingsEditor::_input_filter_focused() {
set_close_on_escape(false);
}

void ProjectSettingsEditor::_input_filter_unfocused() {
set_close_on_escape(true);
}

void ProjectSettingsEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_VISIBILITY_CHANGED: {
Expand Down Expand Up @@ -715,8 +707,8 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
action_map_editor->connect("action_removed", callable_mp(this, &ProjectSettingsEditor::_action_removed));
action_map_editor->connect("action_renamed", callable_mp(this, &ProjectSettingsEditor::_action_renamed));
action_map_editor->connect("action_reordered", callable_mp(this, &ProjectSettingsEditor::_action_reordered));
action_map_editor->connect(SNAME("filter_focused"), callable_mp(this, &ProjectSettingsEditor::_input_filter_focused));
action_map_editor->connect(SNAME("filter_unfocused"), callable_mp(this, &ProjectSettingsEditor::_input_filter_unfocused));
action_map_editor->connect(SNAME("filter_focused"), callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(false));
action_map_editor->connect(SNAME("filter_unfocused"), callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(true));
tab_container->add_child(action_map_editor);

localization_editor = memnew(LocalizationEditor);
Expand Down
3 changes: 0 additions & 3 deletions editor/project_settings_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ class ProjectSettingsEditor : public AcceptDialog {
void _update_action_map_editor();
void _update_theme();

void _input_filter_focused();
void _input_filter_unfocused();

protected:
void _notification(int p_what);
static void _bind_methods();
Expand Down
Loading