diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-04-06 18:42:32 +0200 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-04-06 18:42:32 +0200 |
commit | 44446cf58bcbcfac42244f731e088edb4141145d (patch) | |
tree | 48157386ef5f2493f84612d18a7219ed1c667dad /scene/gui/text_edit.cpp | |
parent | d6871ee847524aea3648095196fa726d52480db2 (diff) | |
parent | c7519f091d6c4bd3f7edc1b8213fb4aa418fad3a (diff) |
Merge pull request #4238 from Paulb23/caret_color
Ability to change the caret color
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r-- | scene/gui/text_edit.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a0dd26b3a6..1a29e6c5f1 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -925,9 +925,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); } @@ -942,9 +942,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); } } } @@ -3060,6 +3060,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"); |