Repository: godotengine/godot
File: editor/inspector/editor_inspector.cpp (C++)

Code before:
			Dictionary clipboard;
			_collect_properties(properties);

			clipboard["path"] = get_inspector_path();
			for (String property_name : properties) {
				clipboard[property_name] = object->get(property_name);
			}
			InspectorDock::get_inspector_singleton()->set_property_clipboard(clipboard);
		} break;
		case MENU_PASTE_VALUE: {
			Dictionary clipboard = InspectorDock::get_inspector_singleton()->get_property_clipboard();
			String group_name = clipboard["path"];

			if (!get_inspector_path().begins_with(group_name)) {
				break;
			}

			Vector<String> properties;
			String action_name = "Set group " + group_name;

			_collect_properties(properties);

			EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
			undo_redo->create_action(action_name);

			for (String property_name : properties) {
				Variant value = clipboard[property_name];
				undo_redo->add_do_property(object, property_name, value);
				undo_redo->add_undo_property(object, property_name, object->get(property_name));
			}

			undo_redo->commit_action();
		} break;
	}
}

void EditorInspectorSection::_bind_methods() {
	ClassDB::bind_method(D_METHOD("setup", "section", "label", "object", "bg_color", "foldable", "indent_depth", "level"), &EditorInspectorSection::setup, DEFVAL(0), DEFVAL(1));
	ClassDB::bind_method(D_METHOD("get_vbox"), &EditorInspectorSection::get_vbox);
	ClassDB::bind_method(D_METHOD("unfold"), &EditorInspectorSection::unfold);
	ClassDB::bind_method(D_METHOD("fold"), &EditorInspectorSection::fold);

	ADD_SIGNAL(MethodInfo("section_toggled_by_user", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::BOOL, "value")));
	ADD_SIGNAL(MethodInfo("property_keyed", PropertyInfo(Variant::STRING_NAME, "property")));
}

EditorInspectorSection::EditorInspectorSection() {
	set_focus_mode(FOCUS_ACCESSIBILITY);

	vbox = memnew(VBoxContainer);


Review comment (suggestion):
```suggestion
			for (const String &property_name : properties) {
```

Code after:
	vbox->show();
	queue_redraw();
}

void EditorInspectorSection::fold() {
	if (!foldable || !vbox_added) {
		return;
	}

	object->editor_set_section_unfold(section, false);
	vbox->hide();
	queue_redraw();
}

void EditorInspectorSection::set_bg_color(const Color &p_bg_color) {
	bg_color = p_bg_color;
	queue_redraw();
}

void EditorInspectorSection::set_keying(bool p_keying) {
	if (keying == (checkable && p_keying)) {
		return;
	}

	keying = checkable && p_keying;
	if (checkable) {
		queue_redraw();
	}
}

void EditorInspectorSection::reset_timer() {
	if (dropping_for_unfold && !dropping_unfold_timer->is_stopped()) {
		dropping_unfold_timer->start();
	}
}

void EditorInspectorSection::set_checkable(const String &p_related_check_property, bool p_checkbox_only, bool p_checked) {
	if (checkable == !p_related_check_property.is_empty()) {
		return;
	}

	checkbox_only = p_checkbox_only;
	checkable = !p_related_check_property.is_empty();
	checked = p_checked;
	related_enable_property = p_related_check_property;

	if (InspectorDock::get_singleton()) {
		if (checkable) {
			InspectorDock::get_inspector_singleton()->connect("property_edited", callable_mp(this, &EditorInspectorSection::_property_edited));
		} else {
			InspectorDock::get_inspector_singleton()->disconnect("property_edited", callable_mp(this, &EditorInspectorSection::_property_edited));