UI: another tweak to panel header drawing, to get the checkboxes positioned right.

This commit is contained in:
Brecht Van Lommel 2011-11-29 23:00:10 +00:00
parent 6ec3313e2d
commit aff705c430
2 changed files with 4 additions and 3 deletions

@ -455,6 +455,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r
hrect= *rect; hrect= *rect;
if(dir == 'h') { if(dir == 'h') {
hrect.xmin= rect->xmin+pnl_icons; hrect.xmin= rect->xmin+pnl_icons;
hrect.ymin += 2.0f/block->aspect;
uiStyleFontDraw(&style->paneltitle, &hrect, activename); uiStyleFontDraw(&style->paneltitle, &hrect, activename);
} }
else { else {
@ -519,9 +520,9 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
maxx -= 5.0f/block->aspect; maxx -= 5.0f/block->aspect;
glColor4f(0.0f, 0.0f, 0.0f, 0.5f); glColor4f(0.0f, 0.0f, 0.0f, 0.5f);
fdrawline(minx, y+1, maxx, y+1);
glColor4f(1.0f, 1.0f, 1.0f, 0.25f);
fdrawline(minx, y, maxx, y); fdrawline(minx, y, maxx, y);
glColor4f(1.0f, 1.0f, 1.0f, 0.25f);
fdrawline(minx, y-1, maxx, y-1);
glDisable(GL_BLEND); glDisable(GL_BLEND);
} }

@ -1596,7 +1596,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
if(pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) { if(pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
/* for enabled buttons */ /* for enabled buttons */
panel->layout= uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, panel->layout= uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
triangle, UI_UNIT_Y+style->panelspace, UI_UNIT_Y, 1, style); triangle, UI_UNIT_Y+style->panelspace+2, UI_UNIT_Y, 1, style);
pt->draw_header(C, panel); pt->draw_header(C, panel);