mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Register theme properties with ThemeDB
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user