Merge pull request #110543 from kitbdev/deprecate_textedit_background_color

Deprecate TextEdit `background_color`
This commit is contained in:
Thaddeus Crews 2025-11-17 10:56:53 -06:00
commit fa1e1bbee7
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
8 changed files with 14 additions and 10 deletions

View file

@ -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<BraceMatchingData> 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);

View file

@ -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;

View file

@ -460,7 +460,9 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_font(SceneStringName(font), "TextEdit", Ref<Font>());
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> &theme, const Ref<Font> &default_font, const
theme->set_font(SceneStringName(font), "CodeEdit", Ref<Font>());
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));