diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-12-18 00:56:33 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-12-18 00:56:33 -0300 |
commit | 9f5bbfc322640c33c4accde98ffaee92a7b62cab (patch) | |
tree | 6bf42041790f969e6804b542490d070385575c65 /scene/gui | |
parent | bed3b7f092881223f7b58c26e65d03b052e5313f (diff) |
-improved completion options for InputEvent, shows all event types now
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 67d786cf49..a8cdfe9063 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -793,6 +793,7 @@ void TextEdit::_notification(int p_what) { int maxlines = get_constant("completion_lines"); int cmax_width = get_constant("completion_max_width")*cache.font->get_char_size('x').x; Color existing = get_color("completion_existing"); + existing.a=0.2; int scrollw = get_constant("completion_scroll_width"); Color scrollc = get_color("completion_scroll_color"); @@ -841,11 +842,20 @@ void TextEdit::_notification(int p_what) { draw_rect(Rect2(completion_rect.pos,Size2(nofs,completion_rect.size.height)),existing); + + + for(int i=0;i<lines;i++) { int l = line_from + i; ERR_CONTINUE( l < 0 || l>= completion_options.size()); - draw_string(cache.font,Point2(completion_rect.pos.x,completion_rect.pos.y+i*get_row_height()+cache.font->get_ascent()),completion_options[l],cache.font_color,completion_rect.size.width); + Color text_color = cache.font_color; + for(int j=0;j<color_regions.size();j++) { + if (completion_options[l].begins_with(color_regions[j].begin_key)) { + text_color=color_regions[j].color; + } + } + draw_string(cache.font,Point2(completion_rect.pos.x,completion_rect.pos.y+i*get_row_height()+cache.font->get_ascent()),completion_options[l],text_color,completion_rect.size.width); } if (scrollw) { |