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.
This commit is contained in:
Yuri Sizov
2023-09-12 15:01:42 +02:00
parent 98b50eb308
commit fe000277ea
26 changed files with 356 additions and 189 deletions

View File

@ -41,6 +41,8 @@
class TextEdit : public Control {
GDCLASS(TextEdit, Control);
friend class CodeHighlighter;
public:
/* Edit Actions. */
enum EditAction {
@ -543,12 +545,6 @@ private:
struct ThemeCache {
float base_scale = 1.0;
/* Internal API for CodeEdit */
Color brace_mismatch_color;
Color code_folding_color = Color(1, 1, 1);
Color folded_code_region_color = Color(1, 1, 1);
Ref<Texture2D> folded_eol_icon;
/* Search */
Color search_result_color = Color(1, 1, 1);
Color search_result_border_color = Color(1, 1, 1);
@ -633,7 +629,7 @@ protected:
virtual void _update_theme_item_cache() override;
/* Internal API for CodeEdit, pending public API. */
// brace matching
// Brace matching.
struct BraceMatchingData {
int open_match_line = -1;
int open_match_column = -1;
@ -662,6 +658,11 @@ protected:
String lookup_symbol_word;
void _set_symbol_lookup_word(const String &p_symbol);
// Theme items.
virtual Color _get_brace_mismatch_color() const { return Color(); };
virtual Color _get_code_folding_color() const { return Color(); };
virtual Ref<Texture2D> _get_folded_eol_icon() const { return Ref<Texture2D>(); };
/* Text manipulation */
// Overridable actions