Merge pull request #10507 from toger5/override_code_them_bg

added setting to override the theme background with editor theme color
This commit is contained in:
Rémi Verschelde 2017-08-22 08:14:46 +02:00 committed by GitHub
commit c2346b92b2
2 changed files with 8 additions and 2 deletions

View File

@ -593,6 +593,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Default");
set("text_editor/theme/line_spacing", 4);
set("text_editor/theme/adapted_code_editor_background_color", true);
_load_default_text_editor_theme();

View File

@ -75,9 +75,14 @@ void ScriptTextEditor::_load_theme_settings() {
text_edit->clear_colors();
/* keyword color */
/* color from color_theme or from editor color */
text_edit->add_color_override("background_color", EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0)));
Color background_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0));
if (EDITOR_DEF("text_editor/theme/adapted_code_editor_background_color", false))
background_color = get_color("dark_color_1", "Editor");
/* keyword color */
text_edit->add_color_override("background_color", background_color);
text_edit->add_color_override("completion_background_color", EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0, 0, 0, 0)));
text_edit->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244")));
text_edit->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")));