diff options
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r-- | editor/editor_inspector.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 9f047c775e..d11c659b98 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -3016,7 +3016,6 @@ void EditorInspector::update_tree() { Vector<String> class_name_components = String(p.class_name).split(","); - array_element_prefix = class_name_components[1]; int page_size = 5; bool movable = true; bool numbered = false; @@ -3052,8 +3051,8 @@ void EditorInspector::update_tree() { editor_inspector_array->set_undo_redo(undo_redo); } else if (p.type == Variant::INT) { // Setup the array to use the count property and built-in functions to create/move/delete elements. - - if (class_name_components.size() > 2) { + if (class_name_components.size() >= 2) { + array_element_prefix = class_name_components[1]; editor_inspector_array = memnew(EditorInspectorArray); int page = per_array_page.has(array_element_prefix) ? per_array_page[array_element_prefix] : 0; @@ -3251,6 +3250,11 @@ void EditorInspector::update_tree() { } if (!hide_metadata) { + // Add 4px of spacing between the "Add Metadata" button and the content above it. + Control *spacer = memnew(Control); + spacer->set_custom_minimum_size(Size2(0, 4) * EDSCALE); + main_vbox->add_child(spacer); + Button *add_md = EditorInspector::create_inspector_action_button(TTR("Add Metadata")); add_md->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); add_md->connect(SNAME("pressed"), callable_mp(this, &EditorInspector::_show_add_meta_dialog)); |