[Bf-blender-cvs] [6fe7bb57549] modifier-panels-ui: UI: Move node socket icons to the left of node input buttons

Julian Eisel noreply at git.blender.org
Thu Apr 16 21:30:29 CEST 2020


Commit: 6fe7bb57549f26341ccfcb75b904230b8bc2bf46
Author: Julian Eisel
Date:   Thu Apr 16 15:21:06 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB6fe7bb57549f26341ccfcb75b904230b8bc2bf46

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

===================================================================

M	source/blender/editors/space_node/node_templates.c

===================================================================

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 */



More information about the Bf-blender-cvs mailing list