diff options
author | Paulb23 <p_batty@hotmail.co.uk> | 2016-06-21 16:50:31 +0100 |
---|---|---|
committer | Paulb23 <p_batty@hotmail.co.uk> | 2016-06-21 16:50:31 +0100 |
commit | a40cb680cae75342ef86443c6996024199b1391d (patch) | |
tree | 96df761217aa5be9c8984aa98537638789fbd74a /scene/gui | |
parent | 6872139300cefae120d6ec9493ebb134c41ec7cc (diff) |
Added code completion background color setting
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 5 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 1 |
2 files changed, 5 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; |