瀏覽代碼

Prevent escape key from closing Editor Settings window when filtering for shorcuts

Robert Yevdokimov 1 年之前
父節點
當前提交
eb565780e7
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      editor/editor_settings_dialog.cpp

+ 2 - 0
editor/editor_settings_dialog.cpp

@@ -772,6 +772,8 @@ EditorSettingsDialog::EditorSettingsDialog() {
 	shortcut_search_by_event->set_stretch_ratio(0.75);
 	shortcut_search_by_event->set_stretch_ratio(0.75);
 	shortcut_search_by_event->set_allowed_input_types(INPUT_KEY);
 	shortcut_search_by_event->set_allowed_input_types(INPUT_KEY);
 	shortcut_search_by_event->connect("event_changed", callable_mp(this, &EditorSettingsDialog::_filter_shortcuts_by_event));
 	shortcut_search_by_event->connect("event_changed", callable_mp(this, &EditorSettingsDialog::_filter_shortcuts_by_event));
+	shortcut_search_by_event->connect("focus_entered", callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(false));
+	shortcut_search_by_event->connect("focus_exited", callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(true));
 	top_hbox->add_child(shortcut_search_by_event);
 	top_hbox->add_child(shortcut_search_by_event);
 
 
 	Button *clear_all_search = memnew(Button);
 	Button *clear_all_search = memnew(Button);