@@ -618,6 +618,16 @@ StringName EditorProperty::get_edited_property() const {
618618 return property;
619619}
620620
621+ Variant EditorProperty::get_edited_property_display_value () const {
622+ ERR_FAIL_NULL_V (object, Variant ());
623+ Control *control = Object::cast_to<Control>(object);
624+ if (checkable && !checked && control && String (property).begins_with (" theme_override_" )) {
625+ return control->get_used_theme_item (property);
626+ } else {
627+ return get_edited_property_value ();
628+ }
629+ }
630+
621631EditorInspector *EditorProperty::get_parent_inspector () const {
622632 Node *parent = get_parent ();
623633 while (parent) {
@@ -4466,13 +4476,26 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) {
44664476 _edit_set (p_path, Variant (), false , " " );
44674477 } else {
44684478 Variant to_create;
4469- List<PropertyInfo> pinfo;
4470- object->get_property_list (&pinfo);
4471- for (const PropertyInfo &E : pinfo) {
4472- if (E.name == p_path) {
4473- Callable::CallError ce;
4474- Variant::construct (E.type , to_create, nullptr , 0 , ce);
4475- break ;
4479+ Control *control = Object::cast_to<Control>(object);
4480+ bool skip = false ;
4481+ if (control && p_path.begins_with (" theme_override_" )) {
4482+ to_create = control->get_used_theme_item (p_path);
4483+ Ref<Resource> resource = to_create;
4484+ if (resource.is_valid ()) {
4485+ to_create = resource->duplicate ();
4486+ }
4487+ skip = true ;
4488+ }
4489+
4490+ if (!skip) {
4491+ List<PropertyInfo> pinfo;
4492+ object->get_property_list (&pinfo);
4493+ for (const PropertyInfo &E : pinfo) {
4494+ if (E.name == p_path) {
4495+ Callable::CallError ce;
4496+ Variant::construct (E.type , to_create, nullptr , 0 , ce);
4497+ break ;
4498+ }
44764499 }
44774500 }
44784501 _edit_set (p_path, to_create, false , " " );
0 commit comments