Fix for own stupid bug the other day, messed up the gradients in selected/deselected UI elements.

Didn't know beta was going to be today, really hope this makes it in!
This commit is contained in:
Matt Ebb 2010-09-11 00:08:07 +00:00
parent cd4fb20b73
commit 0df7cde29a

@ -1419,6 +1419,9 @@ static void widget_state(uiWidgetType *wt, int state)
widget_state_blend(wt->wcol.inner, wcol_state->inner_driven_sel, wcol_state->blend);
VECCOPY(wt->wcol.text, wt->wcol.text_sel);
if(state & UI_SELECT)
SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
}
else {
if(state & UI_BUT_ANIMATED_KEY)
@ -1455,6 +1458,9 @@ static void widget_state_numslider(uiWidgetType *wt, int state)
widget_state_blend(wt->wcol.item, wcol_state->inner_anim_sel, blend);
else if(state & UI_BUT_DRIVEN)
widget_state_blend(wt->wcol.item, wcol_state->inner_driven_sel, blend);
if(state & UI_SELECT)
SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
}
else {
if(state & UI_BUT_ANIMATED_KEY)
@ -1951,6 +1957,9 @@ static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int round
float rad= 0.5f*(rect->ymax - rect->ymin);
float textofs = rad*0.75;
if(state & UI_SELECT)
SWAP(short, wcol->shadetop, wcol->shadedown);
widget_init(&wtb);
/* fully rounded */
@ -2250,7 +2259,9 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
widgetbase_draw(&wtb1, wcol);
VECCOPY(wcol->outline, outline);
SWAP(short, wcol->shadetop, wcol->shadedown);
if(!(state & UI_SELECT))
SWAP(short, wcol->shadetop, wcol->shadedown);
/* outline */
wtb.outline= 1;
@ -2305,6 +2316,9 @@ static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roun
{
uiWidgetBase wtb;
if(state & UI_SELECT)
SWAP(short, wcol->shadetop, wcol->shadedown);
widget_init(&wtb);
/* half rounded */