From 81c2eae018ca3b57cb99f48f51a9d80372167ced Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Fri, 16 Jan 2026 14:21:49 -0300 Subject: [PATCH] Fix size issues with inspector editors --- editor/inspector/editor_inspector.cpp | 17 ++++++++++------- editor/inspector/editor_inspector.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/editor/inspector/editor_inspector.cpp b/editor/inspector/editor_inspector.cpp index 87c901d60d..a268ac8d9d 100644 --- a/editor/inspector/editor_inspector.cpp +++ b/editor/inspector/editor_inspector.cpp @@ -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 ped) { - for (const EditorInspectorPlugin::AddedEditor &F : ped->added_editors) { +void EditorInspector::_parse_added_editors(VBoxContainer *p_current_vbox, EditorInspectorSection *p_section, Ref p_plugin) { + for (const EditorInspectorPlugin::AddedEditor &F : p_plugin->added_editors) { EditorProperty *ep = Object::cast_to(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 &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(); } } diff --git a/editor/inspector/editor_inspector.h b/editor/inspector/editor_inspector.h index b6a9a6eba3..5e9df77e58 100644 --- a/editor/inspector/editor_inspector.h +++ b/editor/inspector/editor_inspector.h @@ -811,7 +811,7 @@ class EditorInspector : public ScrollContainer { void _keying_changed(); - void _parse_added_editors(VBoxContainer *current_vbox, EditorInspectorSection *p_section, Ref ped); + void _parse_added_editors(VBoxContainer *p_current_vbox, EditorInspectorSection *p_section, Ref p_plugin); void _vscroll_changed(double);