summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/gui/text_edit.cpp9
-rw-r--r--scene/gui/text_edit.h1
-rw-r--r--tools/editor/editor_settings.cpp1
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp1
4 files changed, 8 insertions, 4 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 425a88fc0e..321bbb9338 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -910,9 +910,9 @@ void TextEdit::_notification(int p_what) {
cursor_pos = Point2i( char_ofs+char_margin, ofs_y );
if (insert_mode) {
cursor_pos.y += get_row_height();
- VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(char_w,1)),cache.font_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(char_w,1)),cache.caret_color);
} else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.font_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.caret_color);
}
@@ -927,9 +927,9 @@ void TextEdit::_notification(int p_what) {
if (insert_mode) {
cursor_pos.y += get_row_height();
int char_w = cache.font->get_char_size(' ').width;
- VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(char_w,1)),cache.font_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(char_w,1)),cache.caret_color);
} else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.font_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.caret_color);
}
}
}
@@ -3045,6 +3045,7 @@ void TextEdit::_update_caches() {
cache.style_normal=get_stylebox("normal");
cache.style_focus=get_stylebox("focus");
cache.font=get_font("font");
+ cache.caret_color=get_color("caret_color");
cache.font_color=get_color("font_color");
cache.font_selected_color=get_color("font_selected_color");
cache.keyword_color=get_color("keyword_color");
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 43a24bf3c0..cd27469914 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -73,6 +73,7 @@ class TextEdit : public Control {
Ref<StyleBox> style_normal;
Ref<StyleBox> style_focus;
Ref<Font> font;
+ Color caret_color;
Color font_color;
Color font_selected_color;
Color keyword_color;
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index a7c01e0f6f..4ef50b72c2 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -392,6 +392,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
hints["global/default_project_export_path"]=PropertyInfo(Variant::STRING,"global/default_project_export_path",PROPERTY_HINT_GLOBAL_DIR);
set("global/show_script_in_scene_tabs",false);
set("text_editor/background_color",Color::html("3b000000"));
+ set("text_editor/caret_color",Color::html("aaaaaa"));
set("text_editor/text_color",Color::html("aaaaaa"));
set("text_editor/text_selected_color",Color::html("000000"));
set("text_editor/keyword_color",Color::html("ffffb3"));
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index bef1a8e028..d6d5afd166 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -288,6 +288,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("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));
get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1)));
get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1)));
get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2)));