Skip to content

Commit

Permalink
Inspector changes indicator propagates upwards
Browse files Browse the repository at this point in the history
  • Loading branch information
RedMser committed Feb 25, 2024
1 parent 81f3d43 commit 7a08b1f
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2616,8 +2616,17 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, EditorIn
}
}

if (p_section) {
ep->connect("property_can_revert_changed", callable_mp(p_section, &EditorInspectorSection::property_can_revert_changed));
Node *section_search = p_section;
while (section_search) {
EditorInspectorSection *section = Object::cast_to<EditorInspectorSection>(section_search);
if (section) {
ep->connect("property_can_revert_changed", callable_mp(section, &EditorInspectorSection::property_can_revert_changed));
}
section_search = section_search->get_parent();
if (Object::cast_to<EditorInspector>(section_search)) {
// Skip sub-resource inspectors.
break;
}
}

ep->set_read_only(read_only);
Expand Down Expand Up @@ -3311,9 +3320,17 @@ void EditorInspector::update_tree() {
}
}

EditorInspectorSection *section = Object::cast_to<EditorInspectorSection>(current_vbox->get_parent());
if (section) {
ep->connect("property_can_revert_changed", callable_mp(section, &EditorInspectorSection::property_can_revert_changed));
Node *section_search = current_vbox->get_parent();
while (section_search) {
EditorInspectorSection *section = Object::cast_to<EditorInspectorSection>(section_search);
if (section) {
ep->connect("property_can_revert_changed", callable_mp(section, &EditorInspectorSection::property_can_revert_changed));
}
section_search = section_search->get_parent();
if (Object::cast_to<EditorInspector>(section_search)) {
// Skip sub-resource inspectors.
break;
}
}

ep->set_draw_warning(draw_warning);
Expand Down

0 comments on commit 7a08b1f

Please sign in to comment.