[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57541] trunk/blender/source/blender/ editors/interface/interface_widgets.c: Added back left/ right arrows for embossed number fields.
Gaia Clary
gaia.clary at machinimatrix.org
Tue Jun 18 11:02:13 CEST 2013
Revision: 57541
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57541
Author: gaiaclary
Date: 2013-06-18 09:02:13 +0000 (Tue, 18 Jun 2013)
Log Message:
-----------
Added back left/right arrows for embossed number fields. (they where active but not drawn)
Modified Paths:
--------------
trunk/blender/source/blender/editors/interface/interface_widgets.c
Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c 2013-06-18 07:43:05 UTC (rev 57540)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c 2013-06-18 09:02:13 UTC (rev 57541)
@@ -2286,8 +2286,7 @@
}
/* ************ 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 @@
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 @@
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 @@
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 @@
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);
+ }
}
More information about the Bf-blender-cvs
mailing list