diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 3cf96b01449..0dc9e35fe8b 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -1627,7 +1627,7 @@ - + Sets the background [Color] of this [TextEdit]. diff --git a/editor/shader/visual_shader_editor_plugin.cpp b/editor/shader/visual_shader_editor_plugin.cpp index a1ad835996b..90ab7ae217a 100644 --- a/editor/shader/visual_shader_editor_plugin.cpp +++ b/editor/shader/visual_shader_editor_plugin.cpp @@ -1388,7 +1388,6 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool node->add_child(expression_box); register_expression_edit(p_id, expression_box); - Color background_color = EDITOR_GET("text_editor/theme/highlighting/background_color"); Color text_color = EDITOR_GET("text_editor/theme/highlighting/text_color"); Color keyword_color = EDITOR_GET("text_editor/theme/highlighting/keyword_color"); Color control_flow_keyword_color = EDITOR_GET("text_editor/theme/highlighting/control_flow_keyword_color"); @@ -1399,7 +1398,6 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool Color members_color = EDITOR_GET("text_editor/theme/highlighting/member_variable_color"); expression_box->set_syntax_highlighter(expression_syntax_highlighter); - expression_box->add_theme_color_override("background_color", background_color); for (const String &E : editor->keyword_list) { if (ShaderLanguage::is_control_flow_keyword(E)) { @@ -5294,7 +5292,6 @@ void VisualShaderEditor::_notification(int p_what) { shader_preview_button->set_button_icon(Control::get_editor_theme_icon(SNAME("SubViewport"))); { - Color background_color = EDITOR_GET("text_editor/theme/highlighting/background_color"); Color text_color = EDITOR_GET("text_editor/theme/highlighting/text_color"); Color keyword_color = EDITOR_GET("text_editor/theme/highlighting/keyword_color"); Color control_flow_keyword_color = EDITOR_GET("text_editor/theme/highlighting/control_flow_keyword_color"); @@ -5305,7 +5302,6 @@ void VisualShaderEditor::_notification(int p_what) { Color members_color = EDITOR_GET("text_editor/theme/highlighting/member_variable_color"); Color error_color = get_theme_color(SNAME("error_color"), EditorStringName(Editor)); - preview_text->add_theme_color_override("background_color", background_color); varying_error_label->add_theme_color_override(SceneStringName(font_color), error_color); for (const String &E : keyword_list) { diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp index 9fe61dadcb2..b1ef0e98cec 100644 --- a/editor/themes/editor_theme_manager.cpp +++ b/editor/themes/editor_theme_manager.cpp @@ -600,8 +600,6 @@ void EditorThemeManager::_populate_text_editor_styles(const Ref &p_ p_theme->set_stylebox("read_only", "CodeEdit", code_edit_stylebox); p_theme->set_stylebox("focus", "CodeEdit", memnew(StyleBoxEmpty)); - p_theme->set_color("background_color", "CodeEdit", Color(0, 0, 0, 0)); // Unset any color, we use a stylebox. - /* clang-format off */ p_theme->set_color("completion_background_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_background_color")); p_theme->set_color("completion_selected_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_selected_color")); diff --git a/editor/themes/theme_classic.cpp b/editor/themes/theme_classic.cpp index d92a4084fbc..549c55ae38e 100644 --- a/editor/themes/theme_classic.cpp +++ b/editor/themes/theme_classic.cpp @@ -909,7 +909,6 @@ void ThemeClassic::populate_standard_styles(const Ref &p_theme, Edi p_theme->set_color("font_outline_color", "TextEdit", p_config.font_outline_color); p_theme->set_color("caret_color", "TextEdit", p_config.font_color); p_theme->set_color("selection_color", "TextEdit", p_config.selection_color); - p_theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0)); p_theme->set_constant("line_spacing", "TextEdit", 4 * EDSCALE); p_theme->set_constant("outline_size", "TextEdit", 0); diff --git a/editor/themes/theme_modern.cpp b/editor/themes/theme_modern.cpp index ae4bf0edf46..0d4c7766300 100644 --- a/editor/themes/theme_modern.cpp +++ b/editor/themes/theme_modern.cpp @@ -856,7 +856,6 @@ void ThemeModern::populate_standard_styles(const Ref &p_theme, Edit p_theme->set_color("font_outline_color", "TextEdit", p_config.font_outline_color); p_theme->set_color("caret_color", "TextEdit", p_config.font_color); p_theme->set_color("selection_color", "TextEdit", p_config.selection_color); - p_theme->set_color("background_color", "TextEdit", Color(1, 1, 1, 0)); p_theme->set_constant("line_spacing", "TextEdit", 4 * EDSCALE); p_theme->set_constant("outline_size", "TextEdit", 0); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 5d247e2f9c4..738ce39ed09 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -957,9 +957,11 @@ void TextEdit::_notification(int p_what) { int visible_rows = get_visible_line_count() + 1; +#ifndef DISABLE_DEPRECATED if (theme_cache.background_color.a > 0.01) { RS::get_singleton()->canvas_item_add_rect(text_ci, Rect2(Point2i(), get_size()), theme_cache.background_color); } +#endif // DISABLE_DEPRECATED Vector brace_matching; if (highlight_matching_braces_enabled) { @@ -7651,7 +7653,10 @@ void TextEdit::_bind_methods() { BIND_THEME_ITEM(Theme::DATA_TYPE_CONSTANT, TextEdit, line_spacing); BIND_THEME_ITEM(Theme::DATA_TYPE_CONSTANT, TextEdit, wrap_offset); +#ifndef DISABLE_DEPRECATED BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, TextEdit, background_color); +#endif // DISABLE_DEPRECATED + BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, TextEdit, current_line_color); BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, TextEdit, word_highlighted_color); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 5517290224c..b17e205e3bd 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -642,9 +642,12 @@ private: int line_spacing = 1; int wrap_offset = 10; - Color background_color = Color(1, 1, 1); Color current_line_color = Color(1, 1, 1); Color word_highlighted_color = Color(1, 1, 1); + +#ifndef DISABLE_DEPRECATED + Color background_color = Color(1, 1, 1); +#endif // DISABLE_DEPRECATED } theme_cache; bool window_has_focus = true; diff --git a/scene/theme/default_theme.cpp b/scene/theme/default_theme.cpp index 5b97865a06e..e87955bcba2 100644 --- a/scene/theme/default_theme.cpp +++ b/scene/theme/default_theme.cpp @@ -460,7 +460,9 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_font(SceneStringName(font), "TextEdit", Ref()); theme->set_font_size(SceneStringName(font_size), "TextEdit", -1); +#ifndef DISABLE_DEPRECATED theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0)); +#endif // DISABLE_DEPRECATED theme->set_color(SceneStringName(font_color), "TextEdit", control_font_color); theme->set_color("font_selected_color", "TextEdit", Color(0, 0, 0, 0)); theme->set_color("font_readonly_color", "TextEdit", control_font_disabled_color); @@ -501,7 +503,9 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_font(SceneStringName(font), "CodeEdit", Ref()); theme->set_font_size(SceneStringName(font_size), "CodeEdit", -1); +#ifndef DISABLE_DEPRECATED theme->set_color("background_color", "CodeEdit", Color(0, 0, 0, 0)); +#endif // DISABLE_DEPRECATED theme->set_color("completion_background_color", "CodeEdit", Color(0.17, 0.16, 0.2)); theme->set_color("completion_selected_color", "CodeEdit", Color(0.26, 0.26, 0.27)); theme->set_color("completion_existing_color", "CodeEdit", Color(0.87, 0.87, 0.87, 0.13));