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

Code before:
	}
	_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);
	}
	if (icon.is_valid()) {
		ms.height = MAX(theme_cache.class_icon_size, ms.height);
	}
	ms.height += theme_cache.vertical_separation;

	if (theme_cache.background.is_valid()) {
		ms.height += theme_cache.background->get_content_margin(SIDE_TOP) + theme_cache.background->get_content_margin(SIDE_BOTTOM);
	}

	return ms;
}

void EditorInspectorCategory::_collect_properties(const Object *p_object, Vector<String> &p_properties) const {
	List<PropertyInfo> property_list;
	p_object->get_property_list(&property_list, true);

	String current_category = "";
	for (const PropertyInfo &prop_info : property_list) {
		if (prop_info.usage & PROPERTY_USAGE_GROUP) {
			continue;
		}
		if (prop_info.usage & PROPERTY_USAGE_CATEGORY) {
			current_category = prop_info.name;
			continue;
		}
		if (!(prop_info.usage & PROPERTY_USAGE_EDITOR)) {
			continue;
		}
		if (current_category != label && !current_category.ends_with(".gd")) {
			continue;
		}

		p_properties.push_back(prop_info.name);
	}
}

void EditorInspectorCategory::_handle_menu_option(int p_option) {
	switch (p_option) {

Review comment (suggestion):
```suggestion
void EditorInspectorCategory::_collect_properties(const Object *p_object, LocalVector<String> &r_properties) const {
```

Code after:
			DisplayServer::get_singleton()->accessibility_update_set_popup_type(ae, DisplayServer::AccessibilityPopupType::POPUP_MENU);
			DisplayServer::get_singleton()->accessibility_update_add_action(ae, DisplayServer::AccessibilityAction::ACTION_SHOW_CONTEXT_MENU, callable_mp(this, &EditorInspectorCategory::_accessibility_action_menu));
		} break;

		case NOTIFICATION_TRANSLATION_CHANGED: {
			if (is_favorite) {
				label = TTR("Favorites");
			}
			queue_accessibility_update();
		} break;

		case NOTIFICATION_DRAW: {
			const Ref<StyleBox> &sb = theme_cache.background;

			draw_style_box(sb, Rect2(Vector2(), get_size()));

			const Ref<Font> &font = theme_cache.bold_font;
			int font_size = theme_cache.bold_font_size;

			int hs = theme_cache.horizontal_separation;
			int icon_size = theme_cache.class_icon_size;

			int w = font->get_string_size(label, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width;
			if (icon.is_valid()) {
				w += hs + icon_size;
			}
			w = MIN(w, get_size().width - sb->get_minimum_size().width);

			int ofs = (get_size().width - w) / 2;

			float v_margin_offset = sb->get_content_margin(SIDE_TOP) - sb->get_content_margin(SIDE_BOTTOM);

			if (icon.is_valid()) {
				Size2 rect_size = Size2(icon_size, icon_size);
				Point2 rect_pos = Point2(ofs, (get_size().height - icon_size) / 2 + v_margin_offset).round();
				if (is_layout_rtl()) {
					rect_pos.x = get_size().width - rect_pos.x - icon_size;
				}
				draw_texture_rect(icon, Rect2(rect_pos, rect_size));

				ofs += hs + icon_size;
				w -= hs + icon_size;
			}

			if (is_layout_rtl()) {
				ofs = get_size().width - ofs - w;
			}

			// Use TextLine so we have access to accurate font metrics. This way,
			// we can ensure the line is vertically centered regardless of the font used
			// or its size.