Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-04-16 16:21:06 +0300
committerJulian Eisel <julian@blender.org>2020-04-16 16:29:19 +0300
commit7ef2dd84246ceb8c8f88662470360f57a97f7e90 (patch)
treec47d29fa43e74be8fb8724ed1d7bb80dcc7b19bd /source/blender/editors/space_node/node_templates.c
parent675d42dfc33d6c791d9e5da31dcc00930519a127 (diff)
UI: Move node socket icons to the left of node input buttons
Node input buttons (e.g. in the material properties) used to draw their icons on the right of the buttons. However since they represent inputs, it makes more sense conceptually to have them on the left. Further, we might want to add the usual decorator buttons (to control keyframes or display other states) to the material properties as well. Having two circle icons next to each other would be confusing. Differential Revision: https://developer.blender.org/D7409 Reviewed by: Brecht Van Lommel, William Reynish
Diffstat (limited to 'source/blender/editors/space_node/node_templates.c')
-rw-r--r--source/blender/editors/space_node/node_templates.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index da0058585cb..91fe6a97432 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -695,6 +695,7 @@ void uiTemplateNodeLink(
UI_but_type_set_menu_from_pulldown(but);
UI_but_node_link_set(but, sock, socket_col);
+ UI_but_drawflag_enable(but, UI_BUT_ICON_LEFT);
but->poin = (char *)but;
but->func_argN = arg;
@@ -816,6 +817,10 @@ static void ui_node_draw_input(
}
}
else {
+ row = uiLayoutRow(split, true);
+
+ uiTemplateNodeLink(row, C, ntree, node, input);
+
/* input not linked, show value */
if (!(input->flag & SOCK_HIDE_VALUE)) {
switch (input->type) {
@@ -824,25 +829,15 @@ static void ui_node_draw_input(
case SOCK_BOOLEAN:
case SOCK_RGBA:
case SOCK_STRING:
- row = uiLayoutRow(split, true);
uiItemR(row, &inputptr, "default_value", 0, "", ICON_NONE);
break;
case SOCK_VECTOR:
- row = uiLayoutRow(split, false);
+ uiItemS(row);
col = uiLayoutColumn(row, false);
uiItemR(col, &inputptr, "default_value", 0, "", ICON_NONE);
break;
-
- default:
- row = uiLayoutRow(split, false);
- break;
}
}
- else {
- row = uiLayoutRow(split, false);
- }
-
- uiTemplateNodeLink(row, C, ntree, node, input);
}
/* clear */