[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37407] trunk/blender/source/blender/ editors/interface/interface_widgets.c: Bugfix #27138

Ton Roosendaal ton at blender.org
Sat Jun 11 14:10:01 CEST 2011


Revision: 37407
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37407
Author:   ton
Date:     2011-06-11 12:10:01 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
Bugfix #27138

Theme color fix for button type "Value slider".
On text editing mode, the selected part of the text was invisible.

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	2011-06-11 11:49:59 UTC (rev 37406)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2011-06-11 12:10:01 UTC (rev 37407)
@@ -2326,40 +2326,44 @@
 	wtb.outline= 0;
 	widgetbase_draw(&wtb, wcol);
 	
-	/* slider part */
-	VECCOPY(outline, wcol->outline);
-	VECCOPY(wcol->outline, wcol->item);
-	VECCOPY(wcol->inner, wcol->item);
+	/* draw left/right parts only when not in text editing */
+	if(!(state & UI_TEXTINPUT)) {
+		
+			/* slider part */
+		VECCOPY(outline, wcol->outline);
+		VECCOPY(wcol->outline, wcol->item);
+		VECCOPY(wcol->inner, wcol->item);
 
-	if(!(state & UI_SELECT))
-		SWAP(short, wcol->shadetop, wcol->shadedown);
+		if(!(state & UI_SELECT))
+			SWAP(short, wcol->shadetop, wcol->shadedown);
+		
+		rect1= *rect;
+		
+		value= ui_get_but_val(but);
+		fac= ((float)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 & ~9, &rect1, offs);
+		
+		widgetbase_draw(&wtb1, wcol);
+		VECCOPY(wcol->outline, outline);
+		
+		if(!(state & UI_SELECT))
+			SWAP(short, wcol->shadetop, wcol->shadedown);
+	}
 	
-	rect1= *rect;
-	
-	value= ui_get_but_val(but);
-	fac= ((float)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 & ~9, &rect1, offs);
-	
-	widgetbase_draw(&wtb1, wcol);
-	VECCOPY(wcol->outline, outline);
-	
-	if(!(state & UI_SELECT))
-		SWAP(short, wcol->shadetop, wcol->shadedown);
-	
 	/* outline */
 	wtb.outline= 1;
 	wtb.inner= 0;




More information about the Bf-blender-cvs mailing list