[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46909] trunk/blender/source/blender/ editors/space_node/node_buttons.c: Node UI:

Thomas Dinges blender at dingto.org
Tue May 22 21:16:20 CEST 2012


Revision: 46909
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46909
Author:   dingto
Date:     2012-05-22 19:16:20 +0000 (Tue, 22 May 2012)
Log Message:
-----------
Node UI:
* Made the new custom theme options a bit better and more compact.
* Added a few separators to better distinguish these settings from the actual node buttons. 

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/node_buttons.c

Modified: trunk/blender/source/blender/editors/space_node/node_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_buttons.c	2012-05-22 18:40:31 UTC (rev 46908)
+++ trunk/blender/source/blender/editors/space_node/node_buttons.c	2012-05-22 19:16:20 UTC (rev 46909)
@@ -89,7 +89,7 @@
 	SpaceNode *snode= CTX_wm_space_node(C);
 	bNodeTree *ntree= (snode) ? snode->edittree : NULL;
 	bNode *node = (ntree) ? nodeGetActive(ntree) : NULL; // xxx... for editing group nodes
-	uiLayout *layout, *row, *col;
+	uiLayout *layout, *row, *col, *sub;
 	PointerRNA ptr, opptr;
 	
 	/* verify pointers, and create RNA pointer for the node */
@@ -100,7 +100,6 @@
 	//else
 		RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr); 
 	
-	/* XXX nicer way to make sub-layout? */
 	layout = uiLayoutColumn(pa->layout, 0);
 	uiLayoutSetContextPointer(layout, "node", &ptr);
 	
@@ -112,26 +111,35 @@
 	
 	uiItemO(layout, NULL, 0, "NODE_OT_hide_socket_toggle");
 	uiItemS(layout);
+	uiItemS(layout);
 
 	row = uiLayoutRow(layout, 0);
-	uiItemM(row, (bContext *)C, "NODE_MT_node_color_presets", NULL, 0);
-	uiItemM(row, (bContext *)C, "NODE_MT_node_color_specials", "", ICON_DOWNARROW_HLT);
-	uiItemO(row, "", ICON_ZOOMIN, "node.node_color_preset_add");
-	opptr = uiItemFullO(row, "node.node_color_preset_add", "", ICON_ZOOMOUT, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+	
+	col = uiLayoutColumn(row, 1);
+	uiItemM(col, (bContext *)C, "NODE_MT_node_color_presets", NULL, 0);
+	uiItemR(col, &ptr, "use_custom_color", UI_ITEM_R_ICON_ONLY, NULL, ICON_NONE);
+	sub = uiLayoutRow(col, 0);
+	if (!(node->flag & NODE_CUSTOM_COLOR))
+		uiLayoutSetEnabled(sub, 0);
+	uiItemR(sub, &ptr, "color", 0, "", 0);
+	
+	col = uiLayoutColumn(row, 1);
+	uiItemO(col, "", ICON_ZOOMIN, "node.node_color_preset_add");
+	opptr = uiItemFullO(col, "node.node_color_preset_add", "", ICON_ZOOMOUT, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
 	RNA_boolean_set(&opptr, "remove_active", 1);
-
-	row = uiLayoutRow(layout, 0);
-	uiItemR(row, &ptr, "use_custom_color", UI_ITEM_R_ICON_ONLY, NULL, ICON_NONE);
-	col = uiLayoutColumn(row, 0);
-	if (!(node->flag & NODE_CUSTOM_COLOR))
-		uiLayoutSetEnabled(col, 0);
-	uiItemR(col, &ptr, "color", 0, "", 0);
-
+	uiItemM(col, (bContext *)C, "NODE_MT_node_color_specials", "", ICON_BLANK1);
+	
 	/* draw this node's settings */
-	if (node->typeinfo && node->typeinfo->uifuncbut)
+	if (node->typeinfo && node->typeinfo->uifuncbut) {
+		uiItemS(layout);
+		uiItemS(layout);
 		node->typeinfo->uifuncbut(layout, (bContext *)C, &ptr);
-	else if (node->typeinfo && node->typeinfo->uifunc)
+	}
+	else if (node->typeinfo && node->typeinfo->uifunc) {
+		uiItemS(layout);
+		uiItemS(layout);
 		node->typeinfo->uifunc(layout, (bContext *)C, &ptr);
+	}
 }
 
 static int node_sockets_poll(const bContext *C, PanelType *UNUSED(pt))




More information about the Bf-blender-cvs mailing list