summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/gui/text_edit.cpp5
-rw-r--r--scene/gui/text_edit.h1
-rw-r--r--tools/editor/editor_settings.cpp2
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp1
-rw-r--r--tools/editor/plugins/shader_editor_plugin.cpp1
5 files changed, 9 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 7fbd412de8..326771e306 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1089,7 +1089,9 @@ void TextEdit::_notification(int p_what) {
draw_style_box(csb,Rect2(completion_rect.pos-csb->get_offset(),completion_rect.size+csb->get_minimum_size()+Size2(scrollw,0)));
-
+ if (cache.completion_background_color.a>0.01) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(completion_rect.pos,completion_rect.size+Size2(scrollw,0)),cache.completion_background_color);
+ }
int line_from = CLAMP(completion_index - lines/2, 0, completion_options.size() - lines);
draw_style_box(csel,Rect2(Point2(completion_rect.pos.x,completion_rect.pos.y+(completion_index-line_from)*get_row_height()),Size2(completion_rect.size.width,get_row_height())));
@@ -3284,6 +3286,7 @@ void TextEdit::_update_caches() {
cache.style_normal=get_stylebox("normal");
cache.style_focus=get_stylebox("focus");
+ cache.completion_background_color=get_color("completion_background_color");
cache.font=get_font("font");
cache.caret_color=get_color("caret_color");
cache.line_number_color=get_color("line_number_color");
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index f01e6de1c9..0667cae5a5 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -74,6 +74,7 @@ class TextEdit : public Control {
Ref<StyleBox> style_normal;
Ref<StyleBox> style_focus;
Ref<Font> font;
+ Color completion_background_color;
Color caret_color;
Color line_number_color;
Color font_color;
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 0fffaca782..0eca84179f 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -674,6 +674,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
void EditorSettings::_load_default_text_editor_theme() {
set("text_editor/background_color",Color::html("3b000000"));
+ set("text_editor/completion_background_color", Color::html("2C2A32"));
set("text_editor/caret_color",Color::html("aaaaaa"));
set("text_editor/line_number_color",Color::html("66aaaaaa"));
set("text_editor/text_color",Color::html("aaaaaa"));
@@ -906,6 +907,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
String theme_section = "color_theme";
Ref<ConfigFile> cf = memnew( ConfigFile ); // hex is better?
cf->set_value(theme_section, "background_color", ((Color)get("text_editor/background_color")).to_html());
+ cf->set_value(theme_section, "completion_background_color", ((Color)get("text_editor/completion_background_color")).to_html());
cf->set_value(theme_section, "caret_color", ((Color)get("text_editor/caret_color")).to_html());
cf->set_value(theme_section, "line_number_color", ((Color)get("text_editor/line_number_color")).to_html());
cf->set_value(theme_section, "text_color", ((Color)get("text_editor/text_color")).to_html());
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 7de80e767b..401f61f44b 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -287,6 +287,7 @@ void ScriptTextEditor::_load_theme_settings() {
get_text_edit()->set_custom_bg_color(EDITOR_DEF("text_editor/background_color",Color(0,0,0,0)));
+ get_text_edit()->add_color_override("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0)));
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0)));
get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));
diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp
index 83db650952..066dd04410 100644
--- a/tools/editor/plugins/shader_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_editor_plugin.cpp
@@ -78,6 +78,7 @@ void ShaderTextEditor::_load_theme_settings() {
/* keyword color */
get_text_edit()->set_custom_bg_color(EDITOR_DEF("text_editor/background_color",Color(0,0,0,0)));
+ get_text_edit()->add_color_override("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0)));
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0)));
get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));