The TOG3 button (material mapping buttons) didn't get correct color set...
authorTon Roosendaal <ton@blender.org>
Sun, 29 May 2005 10:59:50 +0000 (10:59 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 29 May 2005 10:59:50 +0000 (10:59 +0000)
Was accidentally not visible, until we added texture drawing for fonts.

source/blender/src/interface_draw.c

index 1b8f6e8764cad5a0ab73a1abb794861e32f3ea23..bb204b850dcc99bc441fc1252888fb1ddba863f9 100644 (file)
@@ -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);