Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_draw.c
| Show First 20 Lines • Show All 940 Lines • ▼ Show 20 Lines | // UI_but_flag_enable(but, UI_BUT_DISABLED); | ||||
| } | } | ||||
| else { | else { | ||||
| UI_GetThemeColorBlendShade4fv(TH_SELECT, color_id, 0.4f, 10, color); | UI_GetThemeColorBlendShade4fv(TH_SELECT, color_id, 0.4f, 10, color); | ||||
| } | } | ||||
| /* open/close entirely? */ | /* open/close entirely? */ | ||||
| { | { | ||||
| uiBut *but; | uiBut *but; | ||||
| int but_size = UI_UNIT_X * 1.2f; | int but_size = U.widget_unit * 0.8f; | ||||
| /* XXX button uses a custom triangle draw below, so make it invisible without icon */ | /* XXX button uses a custom triangle draw below, so make it invisible without icon */ | ||||
| UI_block_emboss_set(node->block, UI_EMBOSS_NONE); | UI_block_emboss_set(node->block, UI_EMBOSS_NONE); | ||||
| but = uiDefBut(node->block, UI_BTYPE_BUT_TOGGLE, B_REDR, "", | but = uiDefBut(node->block, UI_BTYPE_BUT_TOGGLE, B_REDR, "", | ||||
| rct->xmin + 0.6f * U.widget_unit - but_size / 2, rct->ymax - NODE_DY / 2.2f - but_size / 2, | rct->xmin + 0.35f * U.widget_unit, rct->ymax - NODE_DY / 2.2f - but_size / 2, | ||||
| but_size, but_size, NULL, 0, 0, 0, 0, ""); | but_size, but_size, NULL, 0, 0, 0, 0, ""); | ||||
| UI_but_func_set(but, node_toggle_button_cb, node, (void *)"NODE_OT_hide_toggle"); | UI_but_func_set(but, node_toggle_button_cb, node, (void *)"NODE_OT_hide_toggle"); | ||||
| UI_block_emboss_set(node->block, UI_EMBOSS); | UI_block_emboss_set(node->block, UI_EMBOSS); | ||||
| UI_GetThemeColor4fv(TH_TEXT, color); | UI_GetThemeColor4fv(TH_TEXT, color); | ||||
| /* custom draw function for this button */ | /* custom draw function for this button */ | ||||
| UI_draw_icon_tri(rct->xmin + 0.6f * U.widget_unit, rct->ymax - NODE_DY / 2.2f, 'v', color); | UI_draw_icon_tri(rct->xmin + 0.65f * U.widget_unit, rct->ymax - NODE_DY / 2.2f, 'v', color); | ||||
| } | } | ||||
| nodeLabel(ntree, node, showname, sizeof(showname)); | nodeLabel(ntree, node, showname, sizeof(showname)); | ||||
| /* XXX - don't print into self! */ | /* XXX - don't print into self! */ | ||||
| //if (node->flag & NODE_MUTED) | //if (node->flag & NODE_MUTED) | ||||
| // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); | // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); | ||||
| ▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node, bNodeInstanceKey UNUSED(key)) | ||||
| } | } | ||||
| else { | else { | ||||
| UI_GetThemeColorBlendShade4fv(TH_SELECT, color_id, 0.4f, 10, color); | UI_GetThemeColorBlendShade4fv(TH_SELECT, color_id, 0.4f, 10, color); | ||||
| } | } | ||||
| /* open entirely icon */ | /* open entirely icon */ | ||||
| { | { | ||||
| uiBut *but; | uiBut *but; | ||||
| int but_size = UI_UNIT_X * 1.2f; | int but_size = U.widget_unit * 0.8f; | ||||
| /* XXX button uses a custom triangle draw below, so make it invisible without icon */ | /* XXX button uses a custom triangle draw below, so make it invisible without icon */ | ||||
| UI_block_emboss_set(node->block, UI_EMBOSS_NONE); | UI_block_emboss_set(node->block, UI_EMBOSS_NONE); | ||||
| but = uiDefBut(node->block, UI_BTYPE_BUT_TOGGLE, B_REDR, "", | but = uiDefBut(node->block, UI_BTYPE_BUT_TOGGLE, B_REDR, "", | ||||
| rct->xmin + 10.0f - but_size / 2, centy - but_size / 2, | rct->xmin + 0.35f * U.widget_unit, centy - but_size / 2, | ||||
| but_size, but_size, NULL, 0, 0, 0, 0, ""); | but_size, but_size, NULL, 0, 0, 0, 0, ""); | ||||
| UI_but_func_set(but, node_toggle_button_cb, node, (void *)"NODE_OT_hide_toggle"); | UI_but_func_set(but, node_toggle_button_cb, node, (void *)"NODE_OT_hide_toggle"); | ||||
| UI_block_emboss_set(node->block, UI_EMBOSS); | UI_block_emboss_set(node->block, UI_EMBOSS); | ||||
| UI_GetThemeColor4fv(TH_TEXT, color); | UI_GetThemeColor4fv(TH_TEXT, color); | ||||
| /* custom draw function for this button */ | /* custom draw function for this button */ | ||||
| UI_draw_icon_tri(rct->xmin + 10.0f, centy, 'h', color); | UI_draw_icon_tri(rct->xmin + 0.65f * U.widget_unit, centy, 'h', color); | ||||
| } | } | ||||
| /* disable lines */ | /* disable lines */ | ||||
| if (node->flag & NODE_MUTED) | if (node->flag & NODE_MUTED) | ||||
| node_draw_mute_line(&ar->v2d, snode, node); | node_draw_mute_line(&ar->v2d, snode, node); | ||||
| if (node->miniwidth > 0.0f) { | if (node->miniwidth > 0.0f) { | ||||
| nodeLabel(ntree, node, showname, sizeof(showname)); | nodeLabel(ntree, node, showname, sizeof(showname)); | ||||
| ▲ Show 20 Lines • Show All 374 Lines • Show Last 20 Lines | |||||