diff options
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 44 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 89 |
3 files changed, 60 insertions, 77 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 2267f04aab4..33aeb2df926 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -58,10 +58,9 @@ /* own include */ #include "interface_intern.h" -#define UI_RB_ALPHA 16 #define UI_DISABLED_ALPHA_OFFS -160 -static int roundboxtype= 15; +static int roundboxtype= UI_CNR_ALL; void uiSetRoundBox(int type) { @@ -69,13 +68,6 @@ void uiSetRoundBox(int type) * if this is undone, its not that big a deal, only makes curves edges * square for the */ roundboxtype= type; - - /* flags to set which corners will become rounded: - - 1------2 - | | - 8------4 - */ } @@ -98,7 +90,7 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r glBegin(mode); /* start with corner right-bottom */ - if(roundboxtype & 4) { + if(roundboxtype & UI_CNR_BOTTOM_RIGHT) { glVertex2f(maxx-rad, miny); for(a=0; a<7; a++) { glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]); @@ -108,7 +100,7 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r else glVertex2f(maxx, miny); /* corner right-top */ - if(roundboxtype & 2) { + if(roundboxtype & UI_CNR_TOP_RIGHT) { glVertex2f(maxx, maxy-rad); for(a=0; a<7; a++) { glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]); @@ -118,7 +110,7 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r else glVertex2f(maxx, maxy); /* corner left-top */ - if(roundboxtype & 1) { + if(roundboxtype & UI_CNR_TOP_LEFT) { glVertex2f(minx+rad, maxy); for(a=0; a<7; a++) { glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]); @@ -128,7 +120,7 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r else glVertex2f(minx, maxy); /* corner left-bottom */ - if(roundboxtype & 8) { + if(roundboxtype & UI_CNR_BOTTOM_LEFT) { glVertex2f(minx, miny+rad); for(a=0; a<7; a++) { glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]); @@ -180,7 +172,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl glBegin(mode); /* start with corner right-bottom */ - if(roundboxtype & 4) { + if(roundboxtype & UI_CNR_BOTTOM_RIGHT) { round_box_shade_col(coltop, coldown, 0.0); glVertex2f(maxx-rad, miny); @@ -199,7 +191,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl } /* corner right-top */ - if(roundboxtype & 2) { + if(roundboxtype & UI_CNR_TOP_RIGHT) { round_box_shade_col(coltop, coldown, (div-rad)*idiv); glVertex2f(maxx, maxy-rad); @@ -217,7 +209,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl } /* corner left-top */ - if(roundboxtype & 1) { + if(roundboxtype & UI_CNR_TOP_LEFT) { round_box_shade_col(coltop, coldown, 1.0); glVertex2f(minx+rad, maxy); @@ -236,7 +228,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl } /* corner left-bottom */ - if(roundboxtype & 8) { + if(roundboxtype & UI_CNR_BOTTOM_LEFT) { round_box_shade_col(coltop, coldown, rad*idiv); glVertex2f(minx, miny+rad); @@ -288,7 +280,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float glBegin(mode); /* start with corner right-bottom */ - if(roundboxtype & 4) { + if(roundboxtype & UI_CNR_BOTTOM_RIGHT) { round_box_shade_col(colLeft, colRight, 0.0); glVertex2f(maxx-rad, miny); @@ -306,7 +298,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float } /* corner right-top */ - if(roundboxtype & 2) { + if(roundboxtype & UI_CNR_TOP_RIGHT) { round_box_shade_col(colLeft, colRight, 0.0); glVertex2f(maxx, maxy-rad); @@ -324,7 +316,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float } /* corner left-top */ - if(roundboxtype & 1) { + if(roundboxtype & UI_CNR_TOP_LEFT) { round_box_shade_col(colLeft, colRight, (div-rad)*idiv); glVertex2f(minx+rad, maxy); @@ -342,7 +334,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float } /* corner left-bottom */ - if(roundboxtype & 8) { + if(roundboxtype & UI_CNR_BOTTOM_LEFT) { round_box_shade_col(colLeft, colRight, 1.0); glVertex2f(minx, miny+rad); @@ -709,7 +701,7 @@ static void draw_scope_end(rctf *rect, GLint *scissor) /* outline */ glColor4f(0.f, 0.f, 0.f, 0.5f); - uiSetRoundBox(15); + uiSetRoundBox(UI_CNR_ALL); uiDrawBox(GL_LINE_LOOP, rect->xmin-1, rect->ymin, rect->xmax+1, rect->ymax+1, 3.0f); } @@ -768,7 +760,7 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol) glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.f, 0.f, 0.f, 0.3f); - uiSetRoundBox(15); + uiSetRoundBox(UI_CNR_ALL); uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); /* need scissor test, histogram can draw outside of boundary */ @@ -837,7 +829,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.f, 0.f, 0.f, 0.3f); - uiSetRoundBox(15); + uiSetRoundBox(UI_CNR_ALL); uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); @@ -1048,7 +1040,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wco glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.f, 0.f, 0.f, 0.3f); - uiSetRoundBox(15); + uiSetRoundBox(UI_CNR_ALL); uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f); /* need scissor test, hvectorscope can draw outside of boundary */ @@ -1233,7 +1225,7 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect) /* backdrop */ glColor3ubv((unsigned char*)wcol->inner); - uiSetRoundBox(15); + uiSetRoundBox(UI_CNR_ALL); uiDrawBox(GL_POLYGON, rect->xmin, rect->ymin, rect->xmax, rect->ymax, 5.0f); /* sphere color */ diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 3b20533dcd4..cd1d250d6a4 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -537,8 +537,8 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) /* in some occasions, draw a border */ if(panel->flag & PNL_SELECT) { - if(panel->control & UI_PNL_SOLID) uiSetRoundBox(15); - else uiSetRoundBox(3); + if(panel->control & UI_PNL_SOLID) uiSetRoundBox(UI_CNR_ALL); + else uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT); UI_ThemeColorShade(TH_BACK, -120); uiRoundRect(0.5f + rect->xmin, 0.5f + rect->ymin, 0.5f + rect->xmax, 0.5f + headrect.ymax+1, 8); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index d9d75c34a94..c36742f7c4d 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -90,15 +90,6 @@ typedef struct uiWidgetTrias { #define WIDGET_CURVE_RESOLU 9 #define WIDGET_SIZE_MAX (WIDGET_CURVE_RESOLU*4) -enum { - WIDGET_TOP_LEFT= 1, - WIDGET_TOP_RIGHT= 2, - WIDGET_BOTTOM_RIGHT= 4, - WIDGET_BOTTOM_LEFT= 8, - /* just for convenience */ - WIDGET_ALL_CORNERS= (WIDGET_TOP_LEFT | WIDGET_TOP_RIGHT | WIDGET_BOTTOM_RIGHT | WIDGET_BOTTOM_LEFT) -}; - typedef struct uiWidgetBase { int totvert, halfwayvert; @@ -249,7 +240,7 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r } /* start with left-top, anti clockwise */ - if(roundboxalign & WIDGET_TOP_LEFT) { + if(roundboxalign & UI_CNR_TOP_LEFT) { for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) { vert[tot][0]= minx+rad-vec[a][0]; vert[tot][1]= maxy-vec[a][1]; @@ -262,7 +253,7 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r } } - if(roundboxalign & WIDGET_BOTTOM_LEFT) { + if(roundboxalign & UI_CNR_BOTTOM_LEFT) { for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) { vert[tot][0]= minx+vec[a][1]; vert[tot][1]= miny+rad-vec[a][0]; @@ -275,7 +266,7 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r } } - if(roundboxalign & WIDGET_BOTTOM_RIGHT) { + if(roundboxalign & UI_CNR_BOTTOM_RIGHT) { for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) { vert[tot][0]= maxx-rad+vec[a][0]; vert[tot][1]= miny+vec[a][1]; @@ -288,7 +279,7 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r } } - if(roundboxalign & WIDGET_TOP_RIGHT) { + if(roundboxalign & UI_CNR_TOP_RIGHT) { for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) { vert[tot][0]= maxx-vec[a][1]; vert[tot][1]= maxy-rad+vec[a][0]; @@ -315,10 +306,10 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl float facxi= (maxxi!=minxi) ? 1.0f/(maxxi-minxi) : 0.0f; /* for uv, can divide by zero */ float facyi= (maxyi!=minyi) ? 1.0f/(maxyi-minyi) : 0.0f; int a, tot= 0, minsize; - const int hnum= ((roundboxalign & (WIDGET_TOP_LEFT|WIDGET_TOP_RIGHT))==(WIDGET_TOP_LEFT|WIDGET_TOP_RIGHT) || - (roundboxalign & (WIDGET_BOTTOM_RIGHT|WIDGET_BOTTOM_LEFT))==(WIDGET_BOTTOM_RIGHT|WIDGET_BOTTOM_LEFT)) ? 1 : 2; - const int vnum= ((roundboxalign & (WIDGET_TOP_LEFT|WIDGET_BOTTOM_LEFT))==(WIDGET_TOP_LEFT|WIDGET_BOTTOM_LEFT) || - (roundboxalign & (WIDGET_TOP_RIGHT|WIDGET_BOTTOM_RIGHT))==(WIDGET_TOP_RIGHT|WIDGET_BOTTOM_RIGHT)) ? 1 : 2; + const int hnum= ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT))==(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT) || + (roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT))==(UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)) ? 1 : 2; + const int vnum= ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT))==(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT) || + (roundboxalign & (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT))==(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) ? 1 : 2; minsize= MIN2((rect->xmax-rect->xmin)*hnum, (rect->ymax-rect->ymin)*vnum); @@ -337,7 +328,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl } /* corner left-bottom */ - if(roundboxalign & WIDGET_BOTTOM_LEFT) { + if(roundboxalign & UI_CNR_BOTTOM_LEFT) { for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) { wt->inner_v[tot][0]= minxi+veci[a][1]; @@ -364,7 +355,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl } /* corner right-bottom */ - if(roundboxalign & WIDGET_BOTTOM_RIGHT) { + if(roundboxalign & UI_CNR_BOTTOM_RIGHT) { for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) { wt->inner_v[tot][0]= maxxi-radi+veci[a][0]; @@ -393,7 +384,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl wt->halfwayvert= tot; /* corner right-top */ - if(roundboxalign & WIDGET_TOP_RIGHT) { + if(roundboxalign & UI_CNR_TOP_RIGHT) { for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) { wt->inner_v[tot][0]= maxxi-veci[a][1]; @@ -420,7 +411,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl } /* corner left-top */ - if(roundboxalign & WIDGET_TOP_LEFT) { + if(roundboxalign & UI_CNR_TOP_LEFT) { for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) { wt->inner_v[tot][0]= minxi+radi-veci[a][0]; @@ -1684,7 +1675,7 @@ static void widget_softshadow(rcti *rect, int roundboxalign, float radin, float rect1.ymax -= 2.0f*radout; /* inner part */ - totvert= round_box_shadow_edges(wtb.inner_v, &rect1, radin, roundboxalign & (WIDGET_BOTTOM_RIGHT | WIDGET_BOTTOM_LEFT), 0.0f); + totvert= round_box_shadow_edges(wtb.inner_v, &rect1, radin, roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT), 0.0f); /* inverse linear shadow alpha */ alpha= 0.15; @@ -1693,7 +1684,7 @@ static void widget_softshadow(rcti *rect, int roundboxalign, float radin, float glEnableClientState(GL_VERTEX_ARRAY); for(step= 1; step<=radout; step++, alpha*=alphastep) { - round_box_shadow_edges(wtb.outer_v, &rect1, radin, WIDGET_ALL_CORNERS, (float)step); + round_box_shadow_edges(wtb.outer_v, &rect1, radin, UI_CNR_ALL, (float)step); glColor4f(0.0f, 0.0f, 0.0f, alpha); @@ -1709,7 +1700,7 @@ static void widget_softshadow(rcti *rect, int roundboxalign, float radin, float static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int direction) { uiWidgetBase wtb; - int roundboxalign= WIDGET_ALL_CORNERS; + int roundboxalign= UI_CNR_ALL; widget_init(&wtb); @@ -1719,11 +1710,11 @@ static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int dir //rect->ymax += 4.0; } else if (direction == UI_DOWN) { - roundboxalign= (WIDGET_BOTTOM_RIGHT | WIDGET_BOTTOM_LEFT); + roundboxalign= (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT); rect->ymin -= 4.0; } else if (direction == UI_TOP) { - roundboxalign= WIDGET_TOP_LEFT | WIDGET_TOP_RIGHT; + roundboxalign= UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT; rect->ymax += 4.0; } @@ -2073,7 +2064,7 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect) widget_init(&wtb); /* fully rounded */ - round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, rad); + round_box_edges(&wtb, UI_CNR_ALL, rect, rad); /* setup temp colors */ wcol_tmp.outline[0]= wcol_tmp.outline[1]= wcol_tmp.outline[2]= 0; @@ -2211,7 +2202,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat if(horizontal) SWAP(short, wcol->shadetop, wcol->shadedown); - round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, rad); + round_box_edges(&wtb, UI_CNR_ALL, rect, rad); widgetbase_draw(&wtb, wcol); /* slider */ @@ -2239,7 +2230,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat if (state & UI_SCROLL_NO_OUTLINE) SWAP(short, outline, wtb.outline); - round_box_edges(&wtb, WIDGET_ALL_CORNERS, slider, rad); + round_box_edges(&wtb, UI_CNR_ALL, slider, rad); if(state & UI_SCROLL_ARROWS) { if(wcol->item[0] > 48) wcol->item[0]-= 48; @@ -2406,7 +2397,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s /* left part of slider, always rounded */ rect1.xmax= rect1.xmin + ceil(offs+1.0f); - round_box_edges(&wtb1, roundboxalign & ~(WIDGET_TOP_RIGHT | WIDGET_BOTTOM_RIGHT), &rect1, offs); + round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT), &rect1, offs); wtb1.outline= 0; widgetbase_draw(&wtb1, wcol); @@ -2417,7 +2408,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s offs*= (rect1.xmax + offs - rect->xmax)/offs; else offs= 0.0f; - round_box_edges(&wtb1, roundboxalign & ~(WIDGET_TOP_LEFT | WIDGET_BOTTOM_LEFT), &rect1, offs); + round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT), &rect1, offs); widgetbase_draw(&wtb1, wcol); VECCOPY(wcol->outline, outline); @@ -2499,7 +2490,7 @@ static void widget_icon_has_anim(uiBut *UNUSED(but), uiWidgetColors *wcol, rcti wtb.outline= 0; /* rounded */ - round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, 10.0f); + round_box_edges(&wtb, UI_CNR_ALL, rect, 10.0f); widgetbase_draw(&wtb, wcol); } } @@ -2562,7 +2553,7 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int widget_init(&wtb); /* half rounded */ - round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, rad); + round_box_edges(&wtb, UI_CNR_ALL, rect, rad); widgetbase_draw(&wtb, wcol); } @@ -2589,7 +2580,7 @@ static void widget_list_itembut(uiWidgetColors *wcol, rcti *rect, int UNUSED(sta /* rounded, but no outline */ wtb.outline= 0; - round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, 4.0f); + round_box_edges(&wtb, UI_CNR_ALL, rect, 4.0f); widgetbase_draw(&wtb, wcol); } @@ -2613,7 +2604,7 @@ static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int UN recttemp.ymax-= delta; /* half rounded */ - round_box_edges(&wtb, WIDGET_ALL_CORNERS, &recttemp, 4.0f); + round_box_edges(&wtb, UI_CNR_ALL, &recttemp, 4.0f); /* decoration */ if(state & UI_SELECT) { @@ -2713,12 +2704,12 @@ static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType * UI_GetThemeColor3ubv(TH_BACK, col); glColor3ubv(col); - round_box__edges(&wtb, WIDGET_ALL_CORNERS, rect, 0.0f, 4.0); + round_box__edges(&wtb, UI_CNR_ALL, rect, 0.0f, 4.0); widgetbase_outline(&wtb); } /* outline */ - round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, 5.0f); + round_box_edges(&wtb, UI_CNR_ALL, rect, 5.0f); wtb.outline= 1; wtb.inner= 0; widgetbase_draw(&wtb, &wt->wcol); @@ -2899,27 +2890,27 @@ static int widget_roundbox_set(uiBut *but, rcti *rect) switch(but->flag & UI_BUT_ALIGN) { case UI_BUT_ALIGN_TOP: - return WIDGET_BOTTOM_LEFT | WIDGET_BOTTOM_RIGHT; + return UI_CNR_BOTTOM_LEFT | UI_CNR_BOTTOM_RIGHT; case UI_BUT_ALIGN_DOWN: - return WIDGET_TOP_LEFT | WIDGET_TOP_RIGHT; + return UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT; case UI_BUT_ALIGN_LEFT: - return WIDGET_TOP_RIGHT | WIDGET_BOTTOM_RIGHT; + return UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT; case UI_BUT_ALIGN_RIGHT: - return WIDGET_TOP_LEFT | WIDGET_BOTTOM_LEFT; + return UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT; case UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_RIGHT: - return WIDGET_TOP_LEFT; + return UI_CNR_TOP_LEFT; case UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_LEFT: - return WIDGET_TOP_RIGHT; + return UI_CNR_TOP_RIGHT; case UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_RIGHT: - return WIDGET_BOTTOM_LEFT; + return UI_CNR_BOTTOM_LEFT; case UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT: - return WIDGET_BOTTOM_RIGHT; + return UI_CNR_BOTTOM_RIGHT; default: return 0; } } - return WIDGET_ALL_CORNERS; + return UI_CNR_ALL; } /* conversion from old to new buttons, so still messy */ @@ -3157,14 +3148,14 @@ void ui_draw_search_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect) uiWidgetType *wt= widget_type(UI_WTYPE_BOX); glEnable(GL_BLEND); - widget_softshadow(rect, WIDGET_ALL_CORNERS, 5.0f, 8.0f); + widget_softshadow(rect, UI_CNR_ALL, 5.0f, 8.0f); glDisable(GL_BLEND); wt->state(wt, 0); if(block) - wt->draw(&wt->wcol, rect, block->flag, WIDGET_ALL_CORNERS); + wt->draw(&wt->wcol, rect, block->flag, UI_CNR_ALL); else - wt->draw(&wt->wcol, rect, 0, WIDGET_ALL_CORNERS); + wt->draw(&wt->wcol, rect, 0, UI_CNR_ALL); } |