diff options
author | Hans Goudey <h.goudey@me.com> | 2021-01-10 22:24:37 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-01-10 22:24:37 +0300 |
commit | 1d3b92bdeabc4a556372603c548155fad1e87be0 (patch) | |
tree | 315946983feaa45291e22d85d20a2949875a2591 /source/blender/editors/space_node/drawnode.c | |
parent | 30310a4fc84cd6b971f58ced42b6eed1343b22e7 (diff) |
UI: Improve node group input / output list interface
This commit replaces the two-column list for editing node group inputs
and outputs with a cleaner solution with two panels. The new layout
has several benefits:
- It uses the vertical space in the node editor sidebar better.
- It should be more familiar because of similarity with other UI lists.
- It should look better with consistent alignment and icons.
Note that displaying the "Name" property outside of the list itself is
a bit inconsistent and could possibly be removed in the future.
Differential Revision: https://developer.blender.org/D9683
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 1333c9ed215..4b5ba2af050 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3665,37 +3665,35 @@ static void std_node_socket_interface_draw(bContext *UNUSED(C), uiLayout *layout { bNodeSocket *sock = ptr->data; int type = sock->typeinfo->type; - /*int subtype = sock->typeinfo->subtype;*/ + + uiLayout *col = uiLayoutColumn(layout, false); switch (type) { case SOCK_FLOAT: { - uiLayout *row; - uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, NULL, 0); - row = uiLayoutRow(layout, true); - uiItemR(row, ptr, "min_value", DEFAULT_FLAGS, IFACE_("Min"), 0); - uiItemR(row, ptr, "max_value", DEFAULT_FLAGS, IFACE_("Max"), 0); + uiItemR(col, ptr, "default_value", DEFAULT_FLAGS, IFACE_("Default"), ICON_NONE); + uiLayout *sub = uiLayoutColumn(col, true); + uiItemR(sub, ptr, "min_value", DEFAULT_FLAGS, IFACE_("Min"), ICON_NONE); + uiItemR(sub, ptr, "max_value", DEFAULT_FLAGS, IFACE_("Max"), ICON_NONE); break; } case SOCK_INT: { - uiLayout *row; - uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, NULL, 0); - row = uiLayoutRow(layout, true); - uiItemR(row, ptr, "min_value", DEFAULT_FLAGS, IFACE_("Min"), 0); - uiItemR(row, ptr, "max_value", DEFAULT_FLAGS, IFACE_("Max"), 0); + uiItemR(col, ptr, "default_value", DEFAULT_FLAGS, IFACE_("Default"), ICON_NONE); + uiLayout *sub = uiLayoutColumn(col, true); + uiItemR(sub, ptr, "min_value", DEFAULT_FLAGS, IFACE_("Min"), ICON_NONE); + uiItemR(sub, ptr, "max_value", DEFAULT_FLAGS, IFACE_("Max"), ICON_NONE); break; } case SOCK_VECTOR: { - uiLayout *row; - uiItemR(layout, ptr, "default_value", UI_ITEM_R_EXPAND, NULL, DEFAULT_FLAGS); - row = uiLayoutRow(layout, true); - uiItemR(row, ptr, "min_value", DEFAULT_FLAGS, IFACE_("Min"), 0); - uiItemR(row, ptr, "max_value", DEFAULT_FLAGS, IFACE_("Max"), 0); + uiItemR(col, ptr, "default_value", UI_ITEM_R_EXPAND, IFACE_("Default"), ICON_NONE); + uiLayout *sub = uiLayoutColumn(col, true); + uiItemR(sub, ptr, "min_value", DEFAULT_FLAGS, IFACE_("Min"), ICON_NONE); + uiItemR(sub, ptr, "max_value", DEFAULT_FLAGS, IFACE_("Max"), ICON_NONE); break; } case SOCK_BOOLEAN: case SOCK_RGBA: case SOCK_STRING: { - uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, NULL, 0); + uiItemR(col, ptr, "default_value", DEFAULT_FLAGS, IFACE_("Default"), 0); break; } } |