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

Code before:
			Object* object = EditorInterface::get_singleton()->get_inspector()->get_edited_object();
			Dictionary clipboard;
			Vector<EditorProperty*> properties;
			_collect_properties(properties);

			clipboard["category_name"] = label;
			for (EditorProperty* prop : properties) {
				String property_name = prop->get_edited_property();
				clipboard[property_name] = object->get(property_name);
			}
			InspectorDock::get_inspector_singleton()->set_property_clipboard(clipboard);
		} break;

		case MENU_PASTE_VALUE: {
			Object* object = EditorInterface::get_singleton()->get_inspector()->get_edited_object();
			Dictionary clipboard = InspectorDock::get_inspector_singleton()->get_property_clipboard();
			String category_name = clipboard["category_name"];
			String action_name = "Set category " + category_name;

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

			for (String property_name : clipboard.keys()) {
				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;

		case MENU_OPEN_DOCS: {
			ScriptEditor::get_singleton()->goto_help("class:" + doc_class_name);
			EditorNode::get_singleton()->get_editor_main_screen()->select(EditorMainScreen::EDITOR_SCRIPT);
		} break;

		case MENU_UNFAVORITE_ALL: {
			emit_signal(SNAME("unfavorite_all"));
		} break;
	}
}

void EditorInspectorCategory::_popup_context_menu(const Point2i &p_position) {
	if (!is_favorite && doc_class_name.is_empty()) {
		return;
	}

	if (menu == nullptr) {
		menu = memnew(PopupMenu);

		if (is_favorite) {

Review comment (suggestion):
```suggestion
			for (const KeyValue<Variant, Variant> &pair : clipboard) {
				const String property_name = pair.key;
				undo_redo->add_do_property(object, property_name, pair.value);
				undo_redo->add_undo_property(object, property_name, object->get(property_name));
```


Code after:
			tl->set_width(w);
			tl->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT);
			float text_pos_y = (get_size().height - tl->get_size().height) / 2 + v_margin_offset;
			Point2 text_pos = Point2(ofs, text_pos_y).round();
			tl->draw(get_canvas_item(), text_pos, theme_cache.font_color);
		} break;
	}
}

void EditorInspectorCategory::_accessibility_action_menu(const Variant &p_data) {
	_popup_context_menu(get_screen_position());
}

Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) const {
	// If it's not a doc tooltip, fallback to the default one.
	if (doc_class_name.is_empty()) {
		return nullptr;
	}

	return EditorHelpBitTooltip::make_tooltip(const_cast<EditorInspectorCategory *>(this), p_text);
}

void EditorInspectorCategory::set_as_favorite() {
	is_favorite = true;
	_update_icon();
}

void EditorInspectorCategory::set_property_info(const PropertyInfo &p_info) {
	info = p_info;

	Ref<Script> scr = _get_category_script(info);
	if (scr.is_valid()) {
		StringName script_name = EditorNode::get_editor_data().script_class_get_name(scr->get_path());
		if (script_name != StringName()) {
			label = script_name;
		}
	}
	if (label.is_empty()) {
		label = info.name;
	}
	_update_icon();
}

void EditorInspectorCategory::set_doc_class_name(const String &p_name) {
	doc_class_name = p_name;
}

Size2 EditorInspectorCategory::get_minimum_size() const {
	Size2 ms;
	if (theme_cache.bold_font.is_valid()) {
		ms.height = theme_cache.bold_font->get_height(theme_cache.bold_font_size);