瀏覽代碼

Merge pull request #25515 from Zylann/search_bar_bottom

Moved script editor search bar to the bottom
Rémi Verschelde 6 年之前
父節點
當前提交
6958953ffa
共有 2 個文件被更改,包括 9 次插入8 次删除
  1. 5 4
      editor/code_editor.cpp
  2. 4 4
      editor/editor_help.cpp

+ 5 - 4
editor/code_editor.cpp

@@ -1226,15 +1226,16 @@ CodeTextEditor::CodeTextEditor() {
 	ED_SHORTCUT("script_editor/zoom_out", TTR("Zoom Out"), KEY_MASK_CMD | KEY_MINUS);
 	ED_SHORTCUT("script_editor/zoom_out", TTR("Zoom Out"), KEY_MASK_CMD | KEY_MINUS);
 	ED_SHORTCUT("script_editor/reset_zoom", TTR("Reset Zoom"), KEY_MASK_CMD | KEY_0);
 	ED_SHORTCUT("script_editor/reset_zoom", TTR("Reset Zoom"), KEY_MASK_CMD | KEY_0);
 
 
+	text_editor = memnew(TextEdit);
+	add_child(text_editor);
+	text_editor->set_v_size_flags(SIZE_EXPAND_FILL);
+
+	// Added second to it opens at the bottom, so it won't shift the entire text editor when opening
 	find_replace_bar = memnew(FindReplaceBar);
 	find_replace_bar = memnew(FindReplaceBar);
 	add_child(find_replace_bar);
 	add_child(find_replace_bar);
 	find_replace_bar->set_h_size_flags(SIZE_EXPAND_FILL);
 	find_replace_bar->set_h_size_flags(SIZE_EXPAND_FILL);
 	find_replace_bar->hide();
 	find_replace_bar->hide();
 
 
-	text_editor = memnew(TextEdit);
-	add_child(text_editor);
-	text_editor->set_v_size_flags(SIZE_EXPAND_FILL);
-
 	find_replace_bar->set_text_edit(text_editor);
 	find_replace_bar->set_text_edit(text_editor);
 
 
 	text_editor->set_show_line_numbers(true);
 	text_editor->set_show_line_numbers(true);

+ 4 - 4
editor/editor_help.cpp

@@ -1423,10 +1423,6 @@ EditorHelp::EditorHelp() {
 
 
 	EDITOR_DEF("text_editor/help/sort_functions_alphabetically", true);
 	EDITOR_DEF("text_editor/help/sort_functions_alphabetically", true);
 
 
-	find_bar = memnew(FindBar);
-	add_child(find_bar);
-	find_bar->hide();
-
 	class_desc = memnew(RichTextLabel);
 	class_desc = memnew(RichTextLabel);
 	add_child(class_desc);
 	add_child(class_desc);
 	class_desc->set_v_size_flags(SIZE_EXPAND_FILL);
 	class_desc->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -1434,6 +1430,10 @@ EditorHelp::EditorHelp() {
 	class_desc->connect("meta_clicked", this, "_class_desc_select");
 	class_desc->connect("meta_clicked", this, "_class_desc_select");
 	class_desc->connect("gui_input", this, "_class_desc_input");
 	class_desc->connect("gui_input", this, "_class_desc_input");
 
 
+	// Added second so it opens at the bottom so it won't offset the entire widget
+	find_bar = memnew(FindBar);
+	add_child(find_bar);
+	find_bar->hide();
 	find_bar->set_rich_text_label(class_desc);
 	find_bar->set_rich_text_label(class_desc);
 
 
 	class_desc->set_selection_enabled(true);
 	class_desc->set_selection_enabled(true);