From fe000277eaea77bb19ca0c5dae650ab4f76ccef0 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Tue, 12 Sep 2023 15:01:42 +0200 Subject: Bind remaining theme properties to their respective classes This adds binds for GraphEdit/GraphElement/GraphNode, which were skipped before due to a rework. This also adds binds for Window, which was skipped before due to a complicated code organization. Also adds theme cache entries/direct cache access to a few places that previously missed it. Some theme properties are now exposed to other classes via friendships or public getters for convenience. This removes all string-based theme access from scene/ classes. --- scene/gui/code_edit.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'scene/gui/code_edit.cpp') diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index f74d7fb906..6ef8eacfd0 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -2399,6 +2399,19 @@ void CodeEdit::set_symbol_lookup_word_as_valid(bool p_valid) { } } +/* Visual */ +Color CodeEdit::_get_brace_mismatch_color() const { + return theme_cache.brace_mismatch_color; +} + +Color CodeEdit::_get_code_folding_color() const { + return theme_cache.code_folding_color; +} + +Ref CodeEdit::_get_folded_eol_icon() const { + return theme_cache.folded_eol_icon; +} + void CodeEdit::_bind_methods() { /* Indent management */ ClassDB::bind_method(D_METHOD("set_indent_size", "size"), &CodeEdit::set_indent_size); @@ -2644,7 +2657,7 @@ void CodeEdit::_bind_methods() { BIND_THEME_ITEM(Theme::DATA_TYPE_ICON, CodeEdit, folded_eol_icon); BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, CodeEdit, breakpoint_color); - BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_COLOR, CodeEdit, breakpoint_icon, "breakpoint"); + BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, CodeEdit, breakpoint_icon, "breakpoint"); BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, CodeEdit, bookmark_color); BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, CodeEdit, bookmark_icon, "bookmark"); @@ -2677,6 +2690,8 @@ void CodeEdit::_bind_methods() { /* Other visuals */ BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_STYLEBOX, CodeEdit, style_normal, "normal"); + BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, CodeEdit, brace_mismatch_color); + BIND_THEME_ITEM(Theme::DATA_TYPE_FONT, CodeEdit, font); BIND_THEME_ITEM(Theme::DATA_TYPE_FONT_SIZE, CodeEdit, font_size); -- cgit v1.2.3