浏览代码

Merge pull request #52913 from Paulb23/text-edit-search-theme

Rémi Verschelde 4 年之前
父节点
当前提交
bfcc29635f
共有 3 个文件被更改,包括 16 次插入0 次删除
  1. 6 0
      doc/classes/CodeEdit.xml
  2. 6 0
      doc/classes/TextEdit.xml
  3. 4 0
      scene/resources/default_theme/default_theme.cpp

+ 6 - 0
doc/classes/CodeEdit.xml

@@ -671,6 +671,12 @@
 		<theme_item name="read_only" data_type="style" type="StyleBox">
 			Sets the [StyleBox] when [member TextEdit.editable] is disabled.
 		</theme_item>
+		<theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)">
+			[Color] of the border around text that matches the search query.
+		</theme_item>
+		<theme_item name="search_result_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 1)">
+			[Color] behind the text that matches the search query.
+		</theme_item>
 		<theme_item name="selection_color" data_type="color" type="Color" default="Color(0.49, 0.49, 0.49, 1)">
 			Sets the highlight [Color] of text selections.
 		</theme_item>

+ 6 - 0
doc/classes/TextEdit.xml

@@ -1212,6 +1212,12 @@
 		<theme_item name="read_only" data_type="style" type="StyleBox">
 			Sets the [StyleBox] of this [TextEdit] when [member editable] is disabled.
 		</theme_item>
+		<theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)">
+			[Color] of the border around text that matches the search query.
+		</theme_item>
+		<theme_item name="search_result_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 1)">
+			[Color] behind the text that matches the search query.
+		</theme_item>
 		<theme_item name="selection_color" data_type="color" type="Color" default="Color(0.49, 0.49, 0.49, 1)">
 			Sets the highlight [Color] of text selections.
 		</theme_item>

+ 4 - 0
scene/resources/default_theme/default_theme.cpp

@@ -438,6 +438,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
 	theme->set_color("caret_color", "TextEdit", control_font_color);
 	theme->set_color("caret_background_color", "TextEdit", Color(0, 0, 0));
 	theme->set_color("word_highlighted_color", "TextEdit", Color(0.8, 0.9, 0.9, 0.15));
+	theme->set_color("search_result_color", "TextEdit", Color(0.3, 0.3, 0.3));
+	theme->set_color("search_result_border_color", "TextEdit", Color(0.3, 0.3, 0.3, 0.4));
 
 	theme->set_constant("line_spacing", "TextEdit", 4 * scale);
 	theme->set_constant("outline_size", "TextEdit", 0);
@@ -483,6 +485,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
 	theme->set_color("line_number_color", "CodeEdit", Color(0.67, 0.67, 0.67, 0.4));
 	theme->set_color("word_highlighted_color", "CodeEdit", Color(0.8, 0.9, 0.9, 0.15));
 	theme->set_color("line_length_guideline_color", "CodeEdit", Color(0.3, 0.5, 0.8, 0.1));
+	theme->set_color("search_result_color", "CodeEdit", Color(0.3, 0.3, 0.3));
+	theme->set_color("search_result_border_color", "CodeEdit", Color(0.3, 0.3, 0.3, 0.4));
 
 	theme->set_constant("completion_lines", "CodeEdit", 7);
 	theme->set_constant("completion_max_width", "CodeEdit", 50);