diff options
author | Ton Roosendaal <ton@blender.org> | 2005-05-29 14:59:50 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-05-29 14:59:50 +0400 |
commit | 66d5a4dd63a88dc23cfc9ae4056bd5d14a2d4bac (patch) | |
tree | d6776b5eb914e78894dc986d7611099abb490fc6 /source/blender/src/interface_draw.c | |
parent | dd79f7c8a8edae3f949c6006390b77ddb4634aef (diff) |
The TOG3 button (material mapping buttons) didn't get correct color set...
Was accidentally not visible, until we added texture drawing for fonts.
Diffstat (limited to 'source/blender/src/interface_draw.c')
-rw-r--r-- | source/blender/src/interface_draw.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c index 1b8f6e8764c..bb204b850dc 100644 --- a/source/blender/src/interface_draw.c +++ b/source/blender/src/interface_draw.c @@ -1479,6 +1479,7 @@ static void ui_draw_text_icon(uiBut *but) } if(but->drawstr[0]!=0) { int transopts; + int tog3= 0; // cut string in 2 parts cpoin= strchr(but->drawstr, '|'); @@ -1498,8 +1499,24 @@ static void ui_draw_text_icon(uiBut *but) else x= (but->x1+but->x2-but->strwidth+1)/2.0; } + /* tog3 button exception; draws with glColor! */ + if(but->type==TOG3 && (but->flag & UI_SELECT)) { + + if( but->pointype==CHA ) { + if( BTST( *(but->poin+2), but->bitnr )) tog3= 1; + } + else if( but->pointype ==SHO ) { + short *sp= (short *)but->poin; + if( BTST( sp[1], but->bitnr )) tog3= 1; + } + + ui_tog3_invert(but->x1,but->y1,but->x2,but->y2, tog3); + if (tog3) glColor3ub(255, 255, 0); + } + /* text color, with pulldown item exception */ - if(but->dt==UI_EMBOSSP) { + if(tog3); // color already set + else if(but->dt==UI_EMBOSSP) { if((but->flag & (UI_SELECT|UI_ACTIVE)) && but->type!=LABEL) { // LABEL = title in pulldowns BIF_ThemeColor(TH_MENU_TEXT_HI); } else { @@ -1514,22 +1531,6 @@ static void ui_draw_text_icon(uiBut *but) } } - /* tog3 button exception */ - if(but->type==TOG3 && (but->flag & UI_SELECT)) { - int ok= 0; - - if( but->pointype==CHA ) { - if( BTST( *(but->poin+2), but->bitnr )) ok= 1; - } - else if( but->pointype ==SHO ) { - short *sp= (short *)but->poin; - if( BTST( sp[1], but->bitnr )) ok= 1; - } - - ui_tog3_invert(but->x1,but->y1,but->x2,but->y2, ok); - if (ok) glColor3ub(255, 255, 0); - } - /* LABEL button exception */ if(but->type==LABEL && but->min!=0.0) BIF_ThemeColor(TH_BUT_TEXT_HI); |