tiny tweaks to hiding triangles etc :)

This commit is contained in:
Matt Ebb
2005-12-28 23:18:02 +00:00
parent 98577f4e02
commit e330e46e88
2 changed files with 18 additions and 11 deletions

View File

@@ -615,12 +615,17 @@ static void node_basis_draw(SpaceNode *snode, bNode *node)
if(node->flag & SELECT)
BIF_ThemeColor(TH_TEXT_HI);
else
BIF_ThemeColor(TH_TEXT);
BIF_ThemeColorBlendShade(TH_TEXT, color_id, 0.4, 10);
/* open/close entirely? */
ui_draw_tria_icon(rct->xmin+6.0f, rct->ymax-NODE_DY+5.0f, snode->aspect, 'v');
ui_draw_tria_icon(rct->xmin+8.0f, rct->ymax-NODE_DY+4.0f, snode->aspect, 'v');
if(node->flag & SELECT)
BIF_ThemeColor(TH_TEXT_HI);
else
BIF_ThemeColor(TH_TEXT);
ui_rasterpos_safe(rct->xmin+18.0f, rct->ymax-NODE_DY+5.0f, snode->aspect);
ui_rasterpos_safe(rct->xmin+19.0f, rct->ymax-NODE_DY+5.0f, snode->aspect);
snode_drawstring(snode, node->name, (int)(iconofs - rct->xmin-18.0f));
/* body */
@@ -717,12 +722,17 @@ void node_hidden_draw(SpaceNode *snode, bNode *node)
if(node->flag & SELECT)
BIF_ThemeColor(TH_TEXT_HI);
else
BIF_ThemeColor(TH_TEXT);
BIF_ThemeColorBlendShade(TH_TEXT, color_id, 0.4, 10);
/* open/close entirely? */
ui_draw_tria_icon(rct->xmin+9.0f, centy-6.0f, snode->aspect, 'h');
ui_rasterpos_safe(rct->xmin+18.0f, centy-4.0f, snode->aspect);
if(node->flag & SELECT)
BIF_ThemeColor(TH_TEXT_HI);
else
BIF_ThemeColor(TH_TEXT);
ui_rasterpos_safe(rct->xmin+21.0f, centy-4.0f, snode->aspect);
snode_drawstring(snode, node->name, (int)(rct->xmax - rct->xmin-18.0f -12.0f));
/* scale widget thing */

View File

@@ -746,15 +746,13 @@ uiBlock *uiFindOpenPanelBlockName(ListBase *lb, char *name)
static void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3)
{
// we draw twice, anti polygons not widely supported...
glBegin(GL_POLYGON);
glVertex2f(x1, y1);
glVertex2f(x2, y2);
glVertex2f(x3, y3);
glEnd();
/* set antialias line */
glEnable( GL_LINE_SMOOTH );
glEnable( GL_BLEND );
@@ -767,17 +765,16 @@ static void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3,
glDisable( GL_LINE_SMOOTH );
glDisable( GL_BLEND );
}
/* triangle 'icon' for panel header */
void ui_draw_tria_icon(float x, float y, float aspect, char dir)
{
if(dir=='h') {
ui_draw_anti_tria( x, y+1, x, y+10.0, x+7, y+6.25);
ui_draw_anti_tria( x, y+1, x, y+10.0, x+8, y+6.25);
}
else {
ui_draw_anti_tria( x-2, y+8, x+9-2, y+8, x+4.75-2, y+1);
ui_draw_anti_tria( x-2, y+9, x+8-2, y+9, x+4.25-2, y+1);
}
}