Respect text editor highlighting color changes

Fix #14838
This commit is contained in:
volzhs
2017-12-27 04:41:08 +09:00
parent edd3bd8cb8
commit 4b0f075e95
5 changed files with 133 additions and 169 deletions

View File

@@ -1056,36 +1056,71 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const Color search_result_color = alpha1;
const Color search_result_border_color = alpha4;
theme->set_color("text_editor/theme/symbol_color", "Editor", symbol_color);
theme->set_color("text_editor/theme/keyword_color", "Editor", keyword_color);
theme->set_color("text_editor/theme/basetype_color", "Editor", basetype_color);
theme->set_color("text_editor/theme/type_color", "Editor", type_color);
theme->set_color("text_editor/theme/comment_color", "Editor", comment_color);
theme->set_color("text_editor/theme/string_color", "Editor", string_color);
theme->set_color("text_editor/theme/background_color", "Editor", te_background_color);
theme->set_color("text_editor/theme/completion_background_color", "Editor", completion_background_color);
theme->set_color("text_editor/theme/completion_selected_color", "Editor", completion_selected_color);
theme->set_color("text_editor/theme/completion_existing_color", "Editor", completion_existing_color);
theme->set_color("text_editor/theme/completion_scroll_color", "Editor", completion_scroll_color);
theme->set_color("text_editor/theme/completion_font_color", "Editor", completion_font_color);
theme->set_color("text_editor/theme/text_color", "Editor", text_color);
theme->set_color("text_editor/theme/line_number_color", "Editor", line_number_color);
theme->set_color("text_editor/theme/caret_color", "Editor", caret_color);
theme->set_color("text_editor/theme/caret_background_color", "Editor", caret_background_color);
theme->set_color("text_editor/theme/text_selected_color", "Editor", text_selected_color);
theme->set_color("text_editor/theme/selection_color", "Editor", selection_color);
theme->set_color("text_editor/theme/brace_mismatch_color", "Editor", brace_mismatch_color);
theme->set_color("text_editor/theme/current_line_color", "Editor", current_line_color);
theme->set_color("text_editor/theme/line_length_guideline_color", "Editor", line_length_guideline_color);
theme->set_color("text_editor/theme/word_highlighted_color", "Editor", word_highlighted_color);
theme->set_color("text_editor/theme/number_color", "Editor", number_color);
theme->set_color("text_editor/theme/function_color", "Editor", function_color);
theme->set_color("text_editor/theme/member_variable_color", "Editor", member_variable_color);
theme->set_color("text_editor/theme/mark_color", "Editor", mark_color);
theme->set_color("text_editor/theme/breakpoint_color", "Editor", breakpoint_color);
theme->set_color("text_editor/theme/code_folding_color", "Editor", code_folding_color);
theme->set_color("text_editor/theme/search_result_color", "Editor", search_result_color);
theme->set_color("text_editor/theme/search_result_border_color", "Editor", search_result_border_color);
EditorSettings *setting = EditorSettings::get_singleton();
String text_editor_color_theme = setting->get("text_editor/theme/color_theme");
if (text_editor_color_theme == "Adaptive") {
setting->set_manually("text_editor/highlighting/symbol_color", symbol_color);
setting->set_manually("text_editor/highlighting/keyword_color", keyword_color);
setting->set_manually("text_editor/highlighting/base_type_color", basetype_color);
setting->set_manually("text_editor/highlighting/engine_type_color", type_color);
setting->set_manually("text_editor/highlighting/comment_color", comment_color);
setting->set_manually("text_editor/highlighting/string_color", string_color);
setting->set_manually("text_editor/highlighting/background_color", background_color);
setting->set_manually("text_editor/highlighting/completion_background_color", completion_background_color);
setting->set_manually("text_editor/highlighting/completion_selected_color", completion_selected_color);
setting->set_manually("text_editor/highlighting/completion_existing_color", completion_existing_color);
setting->set_manually("text_editor/highlighting/completion_scroll_color", completion_scroll_color);
setting->set_manually("text_editor/highlighting/completion_font_color", completion_font_color);
setting->set_manually("text_editor/highlighting/text_color", text_color);
setting->set_manually("text_editor/highlighting/line_number_color", line_number_color);
setting->set_manually("text_editor/highlighting/caret_color", caret_color);
setting->set_manually("text_editor/highlighting/caret_background_color", caret_background_color);
setting->set_manually("text_editor/highlighting/text_selected_color", text_selected_color);
setting->set_manually("text_editor/highlighting/selection_color", selection_color);
setting->set_manually("text_editor/highlighting/brace_mismatch_color", brace_mismatch_color);
setting->set_manually("text_editor/highlighting/current_line_color", current_line_color);
setting->set_manually("text_editor/highlighting/line_length_guideline_color", line_length_guideline_color);
setting->set_manually("text_editor/highlighting/word_highlighted_color", word_highlighted_color);
setting->set_manually("text_editor/highlighting/number_color", number_color);
setting->set_manually("text_editor/highlighting/function_color", function_color);
setting->set_manually("text_editor/highlighting/member_variable_color", member_variable_color);
setting->set_manually("text_editor/highlighting/mark_color", mark_color);
setting->set_manually("text_editor/highlighting/breakpoint_color", breakpoint_color);
setting->set_manually("text_editor/highlighting/code_folding_color", code_folding_color);
setting->set_manually("text_editor/highlighting/search_result_color", search_result_color);
setting->set_manually("text_editor/highlighting/search_result_border_color", search_result_border_color);
} else if (text_editor_color_theme == "Default") {
setting->set_manually("text_editor/highlighting/symbol_color", Color::html("badfff"));
setting->set_manually("text_editor/highlighting/keyword_color", Color::html("ffffb3"));
setting->set_manually("text_editor/highlighting/base_type_color", Color::html("a4ffd4"));
setting->set_manually("text_editor/highlighting/engine_type_color", Color::html("83d3ff"));
setting->set_manually("text_editor/highlighting/comment_color", Color::html("676767"));
setting->set_manually("text_editor/highlighting/string_color", Color::html("ef6ebe"));
setting->set_manually("text_editor/highlighting/background_color", Color::html("3b000000"));
setting->set_manually("text_editor/highlighting/completion_background_color", Color::html("2C2A32"));
setting->set_manually("text_editor/highlighting/completion_selected_color", Color::html("434244"));
setting->set_manually("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf"));
setting->set_manually("text_editor/highlighting/completion_scroll_color", Color::html("ffffff"));
setting->set_manually("text_editor/highlighting/completion_font_color", Color::html("aaaaaa"));
setting->set_manually("text_editor/highlighting/text_color", Color::html("aaaaaa"));
setting->set_manually("text_editor/highlighting/line_number_color", Color::html("66aaaaaa"));
setting->set_manually("text_editor/highlighting/caret_color", Color::html("aaaaaa"));
setting->set_manually("text_editor/highlighting/caret_background_color", Color::html("000000"));
setting->set_manually("text_editor/highlighting/text_selected_color", Color::html("000000"));
setting->set_manually("text_editor/highlighting/selection_color", Color::html("6ca9c2"));
setting->set_manually("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2));
setting->set_manually("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15));
setting->set_manually("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1));
setting->set_manually("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15));
setting->set_manually("text_editor/highlighting/number_color", Color::html("EB9532"));
setting->set_manually("text_editor/highlighting/function_color", Color::html("66a2ce"));
setting->set_manually("text_editor/highlighting/member_variable_color", Color::html("e64e59"));
setting->set_manually("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4));
setting->set_manually("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2));
setting->set_manually("text_editor/highlighting/code_folding_color", Color(0.8, 0.8, 0.8, 0.8));
setting->set_manually("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1));
setting->set_manually("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1));
}
return theme;
}