Fix theme properties not showing their default values when undoing changes

This commit is contained in:
Michael Alexsander 2026-01-14 17:32:33 -03:00
parent 481f36ed20
commit bfccdbecec
No known key found for this signature in database
GPG key ID: A9C91EE110F4EABA

View file

@ -733,7 +733,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();