Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2009-05-22 13:09:07 +0400
committerTon Roosendaal <ton@blender.org>2009-05-22 13:09:07 +0400
commit43fc5606cff210a4031d94fd9da82bd334e7e1d0 (patch)
treed911a7bbafc261ab4695182f8780a110df472253 /source/blender
parent82bd674653dc0b6d45367fc3e5f91ee96ace0a69 (diff)
2.5
Fix in sliders; didn't notice the left part messed up :) Another slider draw method to explore would be like this: (<| -------- |>) Would make it symmetrical, and visually matching number buttons better. (the "<" is background color triangle, without circle around it).
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_widgets.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index a969689c089..00bd3a57334 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1391,22 +1391,30 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
widgetbase_draw(&wtb, wcol);
/* slider part */
+ VECCOPY(outline, wcol->outline);
+ VECCOPY(wcol->outline, wcol->item);
+ VECCOPY(wcol->inner, wcol->item);
+ SWAP(short, wcol->shadetop, wcol->shadedown);
+
rect1= *rect;
value= ui_get_but_val(but);
fac= (value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin);
+ /* left part of slider, always rounded */
+ rect1.xmax= rect1.xmin + ceil(offs+1.0f);
+ round_box_edges(&wtb1, roundboxalign & ~6, &rect1, offs);
+ wtb1.outline= 0;
+ widgetbase_draw(&wtb1, wcol);
+
+ /* right part of slider, interpolate roundness */
rect1.xmax= rect1.xmin + fac + offs;
+ rect1.xmin+= floor(offs-1.0f);
if(rect1.xmax + offs > rect->xmax)
offs*= (rect1.xmax + offs - rect->xmax)/offs;
else
offs= 0.0f;
- round_box_edges(&wtb1, roundboxalign, &rect1, offs);
-
- VECCOPY(outline, wcol->outline);
- VECCOPY(wcol->outline, wcol->item);
- VECCOPY(wcol->inner, wcol->item);
- SWAP(short, wcol->shadetop, wcol->shadedown);
+ round_box_edges(&wtb1, roundboxalign & ~9, &rect1, offs);
widgetbase_draw(&wtb1, wcol);
VECCOPY(wcol->outline, outline);