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:
commit
decc376c12
1 changed files with 2 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue