diff options
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r-- | scene/gui/control.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index d97ce65afc..4510de32a0 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2448,6 +2448,7 @@ void Control::_invalidate_theme_cache() { } void Control::_update_theme_item_cache() { + ThemeDB::get_singleton()->update_class_instance_items(this); } void Control::set_theme_owner_node(Node *p_node) { @@ -2669,6 +2670,27 @@ int Control::get_theme_constant(const StringName &p_name, const StringName &p_th return constant; } +Variant Control::get_theme_item(Theme::DataType p_data_type, const StringName &p_name, const StringName &p_theme_type) const { + switch (p_data_type) { + case Theme::DATA_TYPE_COLOR: + return get_theme_color(p_name, p_theme_type); + case Theme::DATA_TYPE_CONSTANT: + return get_theme_constant(p_name, p_theme_type); + case Theme::DATA_TYPE_FONT: + return get_theme_font(p_name, p_theme_type); + case Theme::DATA_TYPE_FONT_SIZE: + return get_theme_font_size(p_name, p_theme_type); + case Theme::DATA_TYPE_ICON: + return get_theme_icon(p_name, p_theme_type); + case Theme::DATA_TYPE_STYLEBOX: + return get_theme_stylebox(p_name, p_theme_type); + case Theme::DATA_TYPE_MAX: + break; // Can't happen, but silences warning. + } + + return Variant(); +} + #ifdef TOOLS_ENABLED Ref<Texture2D> Control::get_editor_theme_icon(const StringName &p_name) const { return get_theme_icon(p_name, SNAME("EditorIcons")); |