diff options
author | Jacques Lucke <jacques@blender.org> | 2020-03-16 20:25:23 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-03-16 20:25:23 +0300 |
commit | 120a38ccbe0ef4702cc35f9e0cfb841368913eec (patch) | |
tree | 58d55d77f02cc44482bb62bef5a4c0392b7f93ed /source | |
parent | e42f61dda8b635511f083c09ccda5db9d28ec172 (diff) |
Nodes: Display bl_icon of custom nodes in node header
This is D1578 by Philipp Oeser with small modifications.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 35fbbad14b0..d2258db074d 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1181,6 +1181,25 @@ static void node_draw_basis(const bContext *C, UI_but_func_set(but, node_toggle_button_cb, node, (void *)"NODE_OT_group_edit"); UI_block_emboss_set(node->block, UI_EMBOSS); } + if (node->type == NODE_CUSTOM && node->typeinfo->ui_icon != ICON_NONE) { + iconofs -= iconbutw; + UI_block_emboss_set(node->block, UI_EMBOSS_NONE); + uiDefIconBut(node->block, + UI_BTYPE_BUT, + 0, + node->typeinfo->ui_icon, + iconofs, + rct->ymax - NODE_DY, + iconbutw, + UI_UNIT_Y, + NULL, + 0, + 0, + 0, + 0, + ""); + UI_block_emboss_set(node->block, UI_EMBOSS); + } /* title */ if (node->flag & SELECT) { |