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
This commit is contained in:
parent
675d42dfc3
commit
7ef2dd8424
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue