Merge pull request #115041 from YeldhamDev/how_did_this_even_cause_a_regression

Fix size issues with inspector editors
This commit is contained in:
Rémi Verschelde
2026-01-19 10:45:48 +01:00
2 changed files with 11 additions and 8 deletions

View File

@@ -3727,15 +3727,15 @@ String EditorInspector::get_selected_path() const {
return property_selected;
}
void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, EditorInspectorSection *p_section, Ref<EditorInspectorPlugin> ped) {
for (const EditorInspectorPlugin::AddedEditor &F : ped->added_editors) {
void EditorInspector::_parse_added_editors(VBoxContainer *p_current_vbox, EditorInspectorSection *p_section, Ref<EditorInspectorPlugin> p_plugin) {
for (const EditorInspectorPlugin::AddedEditor &F : p_plugin->added_editors) {
EditorProperty *ep = Object::cast_to<EditorProperty>(F.property_editor);
if (ep && !F.properties.is_empty() && current_favorites.has(F.properties[0])) {
ep->favorited = true;
favorites_vbox->add_child(F.property_editor);
} else {
current_vbox->add_child(F.property_editor);
p_current_vbox->add_child(F.property_editor);
}
if (ep) {
@@ -3795,7 +3795,7 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, EditorIn
ep->update_cache();
}
}
ped->added_editors.clear();
p_plugin->added_editors.clear();
}
bool EditorInspector::_is_property_disabled_by_feature_profile(const StringName &p_property) {
@@ -3937,14 +3937,17 @@ void EditorInspector::update_tree() {
bool sub_inspectors_enabled = EDITOR_GET("interface/inspector/open_resources_in_current_inspector");
if (!valid_plugins.is_empty()) {
// Show early to avoid sizing problems.
begin_vbox->show();
for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
ped->parse_begin(object);
_parse_added_editors(begin_vbox, nullptr, ped);
}
// Show if any of the editors were added to the beginning.
if (begin_vbox->get_child_count() > 0) {
begin_vbox->show();
// Hide it again if no editors were added to the beginning.
if (begin_vbox->get_child_count() == 0) {
begin_vbox->hide();
}
}

View File

@@ -811,7 +811,7 @@ class EditorInspector : public ScrollContainer {
void _keying_changed();
void _parse_added_editors(VBoxContainer *current_vbox, EditorInspectorSection *p_section, Ref<EditorInspectorPlugin> ped);
void _parse_added_editors(VBoxContainer *p_current_vbox, EditorInspectorSection *p_section, Ref<EditorInspectorPlugin> p_plugin);
void _vscroll_changed(double);