Merge pull request #115041 from YeldhamDev/how_did_this_even_cause_a_regression
Fix size issues with inspector editors
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user