Fix icon size for items in show list of selectable nodes menu

This commit is contained in:
Giganzo 2026-01-27 12:32:12 +01:00
parent 780b6891e6
commit 60fe933ff6

View file

@ -1731,6 +1731,7 @@ void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
} else if (!selection_results.is_empty()) {
NodePath root_path = get_tree()->get_edited_scene_root()->get_path();
StringName root_name = root_path.get_name(root_path.get_name_count() - 1);
int icon_max_width = EditorNode::get_singleton()->get_editor_theme()->get_constant(SNAME("class_icon_size"), EditorStringName(Editor));
for (int i = 0; i < selection_results.size(); i++) {
Node3D *spat = selection_results[i];
@ -1763,6 +1764,7 @@ void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
}
selection_menu->add_item((String)spat->get_name() + suffix);
selection_menu->set_item_icon(i, icon);
selection_menu->set_item_icon_max_width(i, icon_max_width);
selection_menu->set_item_metadata(i, node_path);
selection_menu->set_item_tooltip(i, String(spat->get_name()) + "\nType: " + spat->get_class() + "\nPath: " + node_path);
}