Merge pull request #102372 from Rindbee/display-the-actual-used-theme-items-in-the-Inspector

Display the actual used theme items in the Inspector
This commit is contained in:
Thaddeus Crews 2025-03-11 16:53:55 -05:00
commit 3bc2821e26
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84
5 changed files with 76 additions and 11 deletions

View file

@ -1326,7 +1326,7 @@ void EditorPropertyInteger::_value_changed(int64_t val) {
}
void EditorPropertyInteger::update_property() {
int64_t val = get_edited_property_value();
int64_t val = get_edited_property_display_value();
spin->set_value_no_signal(val);
#ifdef DEBUG_ENABLED
// If spin (currently EditorSplinSlider : Range) is changed so that it can use int64_t, then the below warning wouldn't be a problem.
@ -2635,7 +2635,7 @@ void EditorPropertyColor::_notification(int p_what) {
}
void EditorPropertyColor::update_property() {
picker->set_pick_color(get_edited_property_value());
picker->set_pick_color(get_edited_property_display_value());
const Color color = picker->get_pick_color();
// Add a tooltip to display each channel's values without having to click the ColorPickerButton
@ -3015,7 +3015,7 @@ void EditorPropertyResource::_resource_selected(const Ref<Resource> &p_resource,
bool unfold = !get_edited_object()->editor_is_section_unfolded(get_edited_property());
get_edited_object()->editor_set_section_unfold(get_edited_property(), unfold);
update_property();
} else {
} else if (!is_checkable() || is_checked()) {
emit_signal(SNAME("resource_selected"), get_edited_property(), p_resource);
}
}
@ -3276,7 +3276,7 @@ void EditorPropertyResource::setup(Object *p_object, const String &p_path, const
}
void EditorPropertyResource::update_property() {
Ref<Resource> res = get_edited_property_value();
Ref<Resource> res = get_edited_property_display_value();
if (use_sub_inspector) {
if (res.is_valid() != resource_picker->is_toggle_mode()) {
@ -3328,6 +3328,8 @@ void EditorPropertyResource::update_property() {
}
}
sub_inspector->set_read_only(is_checkable() && !is_checked());
if (res.ptr() != sub_inspector->get_edited_object()) {
sub_inspector->edit(res.ptr());
_update_property_bg();