From 12c84836b7607cc91ff809f8887a8655fd29e0d7 Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Tue, 23 Jan 2024 11:25:51 -0500 Subject: [PATCH] Make the text editor consistent with the script editor --- editor/plugins/text_editor.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 475aba0eebc..3fdb0388f21 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -612,21 +612,6 @@ TextEditor::TextEditor() { edit_hb = memnew(HBoxContainer); - search_menu = memnew(MenuButton); - search_menu->set_shortcut_context(this); - edit_hb->add_child(search_menu); - search_menu->set_text(TTR("Search")); - search_menu->set_switch_on_hover(true); - search_menu->get_popup()->connect("id_pressed", callable_mp(this, &TextEditor::_edit_option)); - - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find"), SEARCH_FIND); - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT); - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV); - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace"), SEARCH_REPLACE); - search_menu->get_popup()->add_separator(); - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_in_files"), SEARCH_IN_FILES); - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace_in_files"), REPLACE_IN_FILES); - edit_menu = memnew(MenuButton); edit_menu->set_shortcut_context(this); edit_hb->add_child(edit_menu); @@ -685,6 +670,21 @@ TextEditor::TextEditor() { add_syntax_highlighter(highlighter); set_syntax_highlighter(plain_highlighter); + search_menu = memnew(MenuButton); + search_menu->set_shortcut_context(this); + edit_hb->add_child(search_menu); + search_menu->set_text(TTR("Search")); + search_menu->set_switch_on_hover(true); + search_menu->get_popup()->connect("id_pressed", callable_mp(this, &TextEditor::_edit_option)); + + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find"), SEARCH_FIND); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace"), SEARCH_REPLACE); + search_menu->get_popup()->add_separator(); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_in_files"), SEARCH_IN_FILES); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace_in_files"), REPLACE_IN_FILES); + MenuButton *goto_menu = memnew(MenuButton); goto_menu->set_shortcut_context(this); edit_hb->add_child(goto_menu);