diff options
author | Thomas Dinges <blender@dingto.org> | 2012-05-22 23:16:20 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2012-05-22 23:16:20 +0400 |
commit | 1a81499d413e748a26b5f51c5488f257b404e48e (patch) | |
tree | 897e6231abd8d2619641476c2647315f83fe8173 /source/blender/editors/space_node | |
parent | 89fcec812af20faa1022bf9a6e6ba62985244f02 (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/node_buttons.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index 16810e0fdec..c5ccfb7863a 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -89,7 +89,7 @@ static void active_node_panel(const bContext *C, Panel *pa) 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 @@ static void active_node_panel(const bContext *C, Panel *pa) //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 @@ static void active_node_panel(const bContext *C, Panel *pa) 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); - 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); + + 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(col, 0); - uiItemR(col, &ptr, "color", 0, "", 0); - + 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); + 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)) |