* Simple patch 5058 from gsrb3d to use constants instead of magic numbers for

theme drawtypes
This commit is contained in:
Matt Ebb 2006-10-28 13:21:02 +00:00
parent 129cab4137
commit 3e0c45440d
4 changed files with 21 additions and 13 deletions

@ -478,6 +478,11 @@ enum {
};
/* XXX WARNING: previous is saved in file, so do not change order! */
/* theme drawtypes */
#define TH_MINIMAL 0
#define TH_SHADED 1
#define TH_ROUNDED 2
#define TH_OLDSKOOL 3
/* specific defines per space should have higher define values */

@ -5529,7 +5529,7 @@ void uiBlockEndAlign(uiBlock *block)
int flag= 0, cols=0, rows=0;
int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE);
if ( !(theme==0 || theme==1 || theme==2) ) {
if ( !(ELEM3(theme, TH_MINIMAL, TH_SHADED, TH_ROUNDED)) ) {
block->flag &= ~UI_BUT_ALIGN; // all 4 flags
return;
}

@ -2275,19 +2275,22 @@ void ui_set_embossfunc(uiBut *but, int drawtype)
else {
int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE);
// and the themes
if(theme==1) {
switch(theme) {
case TH_ROUNDED:
but->embossfunc= ui_draw_round;
break;
case TH_OLDSKOOL:
but->embossfunc= ui_draw_oldskool;
break;
case TH_MINIMAL:
but->embossfunc= ui_draw_minimal;
break;
case TH_SHADED:
default:
but->embossfunc= ui_draw_default;
but->sliderfunc= ui_default_slider;
}
else if(theme==2) {
but->embossfunc= ui_draw_round;
}
else if(theme==3) {
but->embossfunc= ui_draw_oldskool;
}
else {
but->embossfunc= ui_draw_minimal;
break;
}
}

@ -358,7 +358,7 @@ void BIF_InitTheme(void)
SETCOL(btheme->tui.menu_hilite, 0x7F,0x7F,0x7F, 255);
SETCOL(btheme->tui.menu_text, 0, 0, 0, 255);
SETCOL(btheme->tui.menu_text_hi, 255, 255, 255, 255);
btheme->tui.but_drawtype= 1;
btheme->tui.but_drawtype= TH_SHADED;
/* space view3d */
SETCOL(btheme->tv3d.back, 115, 115, 115, 255);