[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19707] branches/blender2.5/blender/source /blender/editors/interface/interface_widgets.c: 2.5

Ton Roosendaal ton at blender.org
Mon Apr 13 17:55:27 CEST 2009


Revision: 19707
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19707
Author:   ton
Date:     2009-04-13 17:55:27 +0200 (Mon, 13 Apr 2009)

Log Message:
-----------
2.5

Code revamp: moved the animation colors for widget to own struct, was
polluting the per-widget theme colors too much. Still WIP here... it
will go to Theme struct once I've removed all old colors. 

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c

Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c	2009-04-13 14:39:43 UTC (rev 19706)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c	2009-04-13 15:55:27 UTC (rev 19707)
@@ -84,16 +84,19 @@
 	
 } uiWidgetTrias;
 
-typedef struct uiWidgetColors {
-	float outline[3];
-	float inner[4];
-	float inner_sel[4];
+typedef struct uiWidgetStateColors {
 	float inner_anim[4];
 	float inner_anim_sel[4];
 	float inner_key[4];
 	float inner_key_sel[4];
 	float inner_driven[4];
 	float inner_driven_sel[4];
+} uiWidgetStateColors;
+
+typedef struct uiWidgetColors {
+	float outline[3];
+	float inner[4];
+	float inner_sel[4];
 	float item[3];
 	float text[3];
 	float text_sel[3];
@@ -873,16 +876,29 @@
 /* *********************** widget types ************************************* */
 
 
-/*		
- float outline[3];
- float inner[4];
- float inner_sel[4];
+/*   uiWidgetStateColors
  float inner_anim[4];
  float inner_anim_sel[4];
  float inner_key[4];
  float inner_key_sel[4];
  float inner_driven[4];
  float inner_driven_sel[4];
+ 
+*/
+
+static struct uiWidgetStateColors wcol_state= {
+	{0.45, 0.75, 0.3f, 1.0f},
+	{0.35, 0.65, 0.2f, 1.0f},
+	{0.95, 0.9, 0.4f, 1.0f},
+	{0.85, 0.8, 0.3f, 1.0f},
+	{0.7f, 0.0, 1.0f, 1.0f},
+	{0.6f, 0.0, 0.9f, 1.0f}
+};
+
+/*  uiWidgetColors
+ float outline[3];
+ float inner[4];
+ float inner_sel[4];
  float item[3];
  float text[3];
  float text_sel[3];
@@ -895,12 +911,6 @@
 	{0.1f, 0.1f, 0.1f},
 	{0.7f, 0.7f, 0.7f, 1.0f},
 	{0.6f, 0.6f, 0.6f, 1.0f},
-	{0.45, 0.75, 0.3f, 1.0f},
-	{0.35, 0.65, 0.2f, 1.0f},
-	{0.95, 0.9, 0.4f, 1.0f},
-	{0.85, 0.8, 0.3f, 1.0f},
-	{0.7f, 0.0, 1.0f, 1.0f},
-	{0.6f, 0.0, 0.9f, 1.0f},
 	{0.35f, 0.35f, 0.35f},
 	
 	{0.0f, 0.0f, 0.0f},
@@ -914,12 +924,6 @@
 	{0.1f, 0.1f, 0.1f},
 	{0.7f, 0.7f, 0.7f, 1.0f},
 	{0.6f, 0.6f, 0.6f, 1.0f},
-	{0.45, 0.75, 0.3f, 1.0f},
-	{0.35, 0.65, 0.2f, 1.0f},
-	{0.95, 0.9, 0.4f, 1.0f},
-	{0.85, 0.8, 0.3f, 1.0f},
-	{0.7f, 0.0, 1.0f, 1.0f},
-	{0.6f, 0.0, 0.9f, 1.0f},
 	{0.5f, 0.5f, 0.5f},
 	
 	{0.0f, 0.0f, 0.0f},
@@ -933,12 +937,6 @@
 	{0.1f, 0.1f, 0.1f},
 	{0.6f, 0.6f, 0.6f, 1.0f},
 	{0.6f, 0.6f, 0.6f, 1.0f},
-	{0.45, 0.75, 0.3f, 1.0f},
-	{0.35, 0.65, 0.2f, 1.0f},
-	{0.95, 0.9, 0.4f, 1.0f},
-	{0.85, 0.8, 0.3f, 1.0f},
-	{0.7f, 0.0, 1.0f, 1.0f},
-	{0.6f, 0.0, 0.9f, 1.0f},
 	{0.35f, 0.35f, 0.35f},
 	
 	{0.0f, 0.0f, 0.0f},
@@ -952,12 +950,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
 	{0.6f, 0.6f, 0.6f, 1.0f},
 	{0.4f, 0.4f, 0.4f, 1.0f},
-	{0.45, 0.75, 0.3f, 1.0f},
-	{0.35, 0.65, 0.2f, 1.0f},
-	{0.95, 0.9, 0.4f, 1.0f},
-	{0.85, 0.8, 0.3f, 1.0f},
-	{0.7f, 0.0, 1.0f, 1.0f},
-	{0.6f, 0.0, 0.9f, 1.0f},
 	{0.1f, 0.1f, 0.1f},
 	
 	{0.0f, 0.0f, 0.0f},
@@ -1114,11 +1064,11 @@
 	
 	if(state & UI_SELECT) {
 		if(state & UI_BUT_ANIMATED_KEY)
-			QUATCOPY(wt->wcol.inner, wt->wcol.inner_key_sel)
+			QUATCOPY(wt->wcol.inner, wcol_state.inner_key_sel)
 		else if(state & UI_BUT_ANIMATED)
-			QUATCOPY(wt->wcol.inner, wt->wcol.inner_anim_sel)
+			QUATCOPY(wt->wcol.inner, wcol_state.inner_anim_sel)
 		else if(state & UI_BUT_DRIVEN)
-			QUATCOPY(wt->wcol.inner, wt->wcol.inner_driven_sel)
+			QUATCOPY(wt->wcol.inner, wcol_state.inner_driven_sel)
 		else
 			QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel)
 
@@ -1131,11 +1081,11 @@
 	}
 	else {
 		if(state & UI_BUT_ANIMATED_KEY)
-			QUATCOPY(wt->wcol.inner, wt->wcol.inner_key)
+			QUATCOPY(wt->wcol.inner, wcol_state.inner_key)
 		else if(state & UI_BUT_ANIMATED)
-			QUATCOPY(wt->wcol.inner, wt->wcol.inner_anim)
+			QUATCOPY(wt->wcol.inner, wcol_state.inner_anim)
 		else if(state & UI_BUT_DRIVEN)
-			QUATCOPY(wt->wcol.inner, wt->wcol.inner_driven)
+			QUATCOPY(wt->wcol.inner, wcol_state.inner_driven)
 
 		if(state & UI_ACTIVE) /* mouse over? */
 			VecMulf(wt->wcol.inner, 1.1f);





More information about the Bf-blender-cvs mailing list