Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/drawnode.cc
| Show First 20 Lines • Show All 3,593 Lines • ▼ Show 20 Lines | case SOCK_IMAGE: { | ||||
| 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: { | ||||
| uiTemplateID( | uiTemplateID( | ||||
| layout, C, ptr, "default_value", "texture.new", nullptr, nullptr, 0, ICON_NONE, nullptr); | layout, C, ptr, "default_value", "texture.new", nullptr, nullptr, 0, ICON_NONE, text); | ||||
| 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); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static void std_node_socket_interface_draw(bContext *UNUSED(C), uiLayout *layout, PointerRNA *ptr) | static void std_node_socket_interface_draw(bContext *UNUSED(C), uiLayout *layout, PointerRNA *ptr) | ||||
| { | { | ||||
HooglyBoogly: 0.4 is generally the standard for splits in the UI currently. I guess you used 0.3 because… | |||||
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… | |||||
| bNodeSocket *sock = (bNodeSocket *)ptr->data; | bNodeSocket *sock = (bNodeSocket *)ptr->data; | ||||
| int type = sock->typeinfo->type; | int type = sock->typeinfo->type; | ||||
| uiLayout *col = uiLayoutColumn(layout, false); | uiLayout *col = uiLayoutColumn(layout, false); | ||||
| switch (type) { | switch (type) { | ||||
| case SOCK_FLOAT: { | case SOCK_FLOAT: { | ||||
| uiItemR(col, ptr, "default_value", DEFAULT_FLAGS, IFACE_("Default"), ICON_NONE); | uiItemR(col, ptr, "default_value", DEFAULT_FLAGS, IFACE_("Default"), ICON_NONE); | ||||
| ▲ Show 20 Lines • Show All 647 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.