Added code completion existing color setting

This commit is contained in:
Paulb23 2016-06-21 17:34:38 +01:00
parent 706895a922
commit 45f0dec55c
6 changed files with 7 additions and 4 deletions

View File

@ -1043,8 +1043,6 @@ void TextEdit::_notification(int p_what) {
Ref<StyleBox> csb = get_stylebox("completion"); Ref<StyleBox> csb = get_stylebox("completion");
int maxlines = get_constant("completion_lines"); int maxlines = get_constant("completion_lines");
int cmax_width = get_constant("completion_max_width")*cache.font->get_char_size('x').x; 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"); int scrollw = get_constant("completion_scroll_width");
Color scrollc = get_color("completion_scroll_color"); Color scrollc = get_color("completion_scroll_color");
@ -1093,7 +1091,7 @@ void TextEdit::_notification(int p_what) {
} }
int line_from = CLAMP(completion_index - lines/2, 0, completion_options.size() - lines); int line_from = CLAMP(completion_index - lines/2, 0, completion_options.size() - lines);
VisualServer::get_singleton()->canvas_item_add_rect(ci,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())),cache.completion_selected_color); VisualServer::get_singleton()->canvas_item_add_rect(ci,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())),cache.completion_selected_color);
draw_rect(Rect2(completion_rect.pos,Size2(nofs,completion_rect.size.height)),existing); draw_rect(Rect2(completion_rect.pos,Size2(nofs,completion_rect.size.height)),cache.completion_existing_color);
@ -3286,6 +3284,7 @@ void TextEdit::_update_caches() {
cache.style_focus=get_stylebox("focus"); cache.style_focus=get_stylebox("focus");
cache.completion_background_color=get_color("completion_background_color"); cache.completion_background_color=get_color("completion_background_color");
cache.completion_selected_color=get_color("completion_selected_color"); cache.completion_selected_color=get_color("completion_selected_color");
cache.completion_existing_color=get_color("completion_existing_color");
cache.font=get_font("font"); cache.font=get_font("font");
cache.caret_color=get_color("caret_color"); cache.caret_color=get_color("caret_color");
cache.line_number_color=get_color("line_number_color"); cache.line_number_color=get_color("line_number_color");

View File

@ -76,6 +76,7 @@ class TextEdit : public Control {
Ref<Font> font; Ref<Font> font;
Color completion_background_color; Color completion_background_color;
Color completion_selected_color; Color completion_selected_color;
Color completion_existing_color;
Color caret_color; Color caret_color;
Color line_number_color; Color line_number_color;
Color font_color; Color font_color;

View File

@ -470,7 +470,6 @@ void fill_default_theme(Ref<Theme>& t,const Ref<Font> & default_font,const Ref<F
t->set_font("font","TextEdit", default_font ); t->set_font("font","TextEdit", default_font );
t->set_color("completion_scroll_color","TextEdit", control_font_color_pressed ); t->set_color("completion_scroll_color","TextEdit", control_font_color_pressed );
t->set_color("completion_existing","TextEdit", control_font_color );
t->set_color("font_color","TextEdit", control_font_color ); t->set_color("font_color","TextEdit", control_font_color );
t->set_color("font_color_selected","TextEdit", Color(0,0,0) ); t->set_color("font_color_selected","TextEdit", Color(0,0,0) );
t->set_color("selection_color","TextEdit", font_color_selection ); t->set_color("selection_color","TextEdit", font_color_selection );

View File

@ -676,6 +676,7 @@ void EditorSettings::_load_default_text_editor_theme() {
set("text_editor/background_color",Color::html("3b000000")); set("text_editor/background_color",Color::html("3b000000"));
set("text_editor/completion_background_color", Color::html("2C2A32")); set("text_editor/completion_background_color", Color::html("2C2A32"));
set("text_editor/completion_selected_color", Color::html("434244")); set("text_editor/completion_selected_color", Color::html("434244"));
set("text_editor/completion_existing_color", Color::html("21dfdfdf"));
set("text_editor/caret_color",Color::html("aaaaaa")); set("text_editor/caret_color",Color::html("aaaaaa"));
set("text_editor/line_number_color",Color::html("66aaaaaa")); set("text_editor/line_number_color",Color::html("66aaaaaa"));
set("text_editor/text_color",Color::html("aaaaaa")); set("text_editor/text_color",Color::html("aaaaaa"));
@ -910,6 +911,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
cf->set_value(theme_section, "background_color", ((Color)get("text_editor/background_color")).to_html()); 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, "completion_background_color", ((Color)get("text_editor/completion_background_color")).to_html());
cf->set_value(theme_section, "completion_selected_color", ((Color)get("text_editor/completion_selected_color")).to_html()); cf->set_value(theme_section, "completion_selected_color", ((Color)get("text_editor/completion_selected_color")).to_html());
cf->set_value(theme_section, "completion_existing_color", ((Color)get("text_editor/completion_existing_color")).to_html());
cf->set_value(theme_section, "caret_color", ((Color)get("text_editor/caret_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, "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()); cf->set_value(theme_section, "text_color", ((Color)get("text_editor/text_color")).to_html());

View File

@ -289,6 +289,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()->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("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0)));
get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244"))); get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244")));
get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf")));
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(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("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))); get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));

View File

@ -80,6 +80,7 @@ void ShaderTextEditor::_load_theme_settings() {
get_text_edit()->set_custom_bg_color(EDITOR_DEF("text_editor/background_color",Color(0,0,0,0))); 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("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0)));
get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244"))); get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244")));
get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf")));
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(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("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))); get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));