Merge pull request #114962 from YeldhamDev/inspector_theme_empty_fix

Fix theme properties not showing their default values when undoing changes
This commit is contained in:
Thaddeus Crews 2026-03-06 12:40:26 -06:00
commit decc376c12
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -743,7 +743,8 @@ StringName EditorProperty::get_edited_property() const {
Variant EditorProperty::get_edited_property_display_value() const {
ERR_FAIL_NULL_V(object, Variant());
Control *control = Object::cast_to<Control>(object);
if (checkable && !checked && control && String(property).begins_with("theme_override_")) {
// If checked but it's empty, it means that the set value has just been undone, and should show the default value as well.
if (control && checkable && (!checked || get_edited_property_value() == Variant()) && String(property).begins_with("theme_override_")) {
return control->get_used_theme_item(property);
} else {
return get_edited_property_value();