1
0
Fork 0

Fix icon resizing for `NodePath` properties not working

This commit is contained in:
Michael Alexsander 2025-12-18 16:04:27 -03:00
parent 8a6408c1ce
commit 12e451bb53
No known key found for this signature in database
GPG Key ID: A9C91EE110F4EABA
1 changed files with 3 additions and 2 deletions

View File

@ -3200,6 +3200,9 @@ void EditorPropertyNodePath::_notification(int p_what) {
menu->get_popup()->set_item_icon(ACTION_COPY, get_editor_theme_icon(SNAME("ActionCopy")));
menu->get_popup()->set_item_icon(ACTION_EDIT, get_editor_theme_icon(SNAME("Edit")));
menu->get_popup()->set_item_icon(ACTION_SELECT, get_editor_theme_icon(SNAME("ExternalLink")));
// Use a constant width for the icon to avoid sizing issues or blurry icons.
assign->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)));
} break;
case NOTIFICATION_DRAG_BEGIN: {
@ -3260,8 +3263,6 @@ EditorPropertyNodePath::EditorPropertyNodePath() {
assign->set_h_size_flags(SIZE_EXPAND_FILL);
assign->set_clip_text(true);
assign->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
// Use a constant width for the icon to avoid sizing issues or blurry icons.
assign->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)));
assign->set_expand_icon(true);
assign->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyNodePath::_node_assign));
assign->connect(SceneStringName(draw), callable_mp(this, &EditorPropertyNodePath::_assign_draw));