diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-06-18 13:02:13 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-06-18 13:02:13 +0400 |
commit | 943388183d2b3a4503799b0e3c09f34e9be7d85f (patch) | |
tree | 574f0324e8e6a10dc22f568ae3db4d13ab1c97c2 /source/blender | |
parent | b0872918ea9938f83a9e9c52184fa1e335bff0f4 (diff) |
Added back left/right arrows for embossed number fields. (they where active but not drawn)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 00eabad729e..717b45496ae 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2286,8 +2286,7 @@ static void ui_draw_separator(const rcti *rect, uiWidgetColors *wcol) } /* ************ button callbacks, draw ***************** */ - -static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_numbut_draw(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, bool emboss) { uiWidgetBase wtb; const float rad = 0.5f * BLI_rcti_size_y(rect); @@ -2298,9 +2297,10 @@ static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int round widget_init(&wtb); - /* fully rounded */ - round_box_edges(&wtb, roundboxalign, rect, rad); - + if (!emboss) { + round_box_edges(&wtb, roundboxalign, rect, rad); + } + /* decoration */ if (!(state & UI_TEXTINPUT)) { widget_num_tria(&wtb.tria1, rect, 0.6f, 'l'); @@ -2314,6 +2314,19 @@ static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int round rect->xmax -= textofs; } +static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +{ + widget_numbut_draw(wcol, rect, state, roundboxalign, false); +} + +/* + * Draw number buttons still with triangles when field is not embossed +*/ +static void widget_numbut_embossn(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +{ + widget_numbut_draw(wcol, rect, state, roundboxalign, true); +} + int ui_link_bezier_points(const rcti *rect, float coord_array[][2], int resol) { float dist, vec[4][2]; @@ -2671,7 +2684,7 @@ static void widget_normal(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUS ui_draw_but_NORMAL(but, wcol, rect); } -static void widget_icon_has_anim(uiBut *UNUSED(but), uiWidgetColors *wcol, rcti *rect, int state, int UNUSED(roundboxalign)) +static void widget_icon_has_anim(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) { if (state & (UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN | UI_BUT_REDALERT)) { uiWidgetBase wtb; @@ -2685,6 +2698,11 @@ static void widget_icon_has_anim(uiBut *UNUSED(but), uiWidgetColors *wcol, rcti round_box_edges(&wtb, UI_CNR_ALL, rect, rad); widgetbase_draw(&wtb, wcol); } + else if (but->type == NUM) { + /* Draw number buttons still with left/right + * triangles when field is not embossed */ + widget_numbut_embossn(but, wcol, rect, state, roundboxalign); + } } |