Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/drawnode.cc
| Show First 20 Lines • Show All 3,592 Lines • ▼ Show 20 Lines | case SOCK_IMAGE: { | ||||
| uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0); | uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0); | ||||
| break; | break; | ||||
| } | } | ||||
| case SOCK_COLLECTION: { | case SOCK_COLLECTION: { | ||||
| uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0); | uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0); | ||||
| break; | break; | ||||
| } | } | ||||
| case SOCK_TEXTURE: { | case SOCK_TEXTURE: { | ||||
| if (text == "") { | |||||
| uiTemplateID(layout, | |||||
| C, | |||||
| ptr, | |||||
| "default_value", | |||||
| "texture.new", | |||||
| nullptr, | |||||
| nullptr, | |||||
| 0, | |||||
| ICON_NONE, | |||||
| nullptr); | |||||
| } | |||||
| else { | |||||
| /* Split because the texture button takes up a lot of space. */ | |||||
| uiLayout *row = uiLayoutSplit(layout, 0.3f, false); | |||||
HooglyBoogly: 0.4 is generally the standard for splits in the UI currently. I guess you used 0.3 because… | |||||
WannesAuthorUnsubmitted Done Inline ActionsYup, I tried 0.4f first and it didn't look good enough, so I went with 0.3f. If that is not Ok, we'd need to use a different function here to get a better layout. Wannes: Yup, I tried 0.4f first and it didn't look good enough, so I went with 0.3f. If that is not Ok… | |||||
| uiItemL(row, text, 0); | |||||
| uiTemplateID( | uiTemplateID( | ||||
| layout, C, ptr, "default_value", "texture.new", nullptr, nullptr, 0, ICON_NONE, nullptr); | row, C, ptr, "default_value", "texture.new", nullptr, nullptr, 0, ICON_NONE, nullptr); | ||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| case SOCK_MATERIAL: { | case SOCK_MATERIAL: { | ||||
| uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0); | uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0); | ||||
| break; | break; | ||||
| } | } | ||||
| default: | default: | ||||
| node_socket_button_label(C, layout, ptr, node_ptr, text); | node_socket_button_label(C, layout, ptr, node_ptr, text); | ||||
| ▲ Show 20 Lines • Show All 661 Lines • Show Last 20 Lines | |||||
0.4 is generally the standard for splits in the UI currently. I guess you used 0.3 because otherwise the buttons get squashed at the default node width? I wonder if it's worth it to differ here.