[Bf-blender-cvs] [b88e700] master: Cleanup: Minor edits to widget emboss code

julianeisel noreply at git.blender.org
Mon Dec 8 00:42:24 CET 2014


Commit: b88e700df453eba0a512688fba6e25f4cdc3edf0
Author: julianeisel
Date:   Mon Dec 8 00:38:36 2014 +0100
Branches: master
https://developer.blender.org/rBb88e700df453eba0a512688fba6e25f4cdc3edf0

Cleanup: Minor edits to widget emboss code

* Rename "emboss" to "widget_emboss"
* Remove duplicated UI_GetThemeColor4ubv function

I made sure version bump and Save User Settings are working correctly ;P

===================================================================

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/include/UI_resources.h
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/interface/resources.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 8262115..10394e5 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -776,7 +776,7 @@ class USERPREF_PT_theme(Panel):
             padding = subsplit.split(percentage=0.15)
             colsub = padding.column()
             colsub = padding.column()
-            colsub.row().prop(ui, "emboss")
+            colsub.row().prop(ui, "widget_emboss")
 
             col.separator()
             col.separator()
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 8e37e87..c3d6dd5 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -266,7 +266,7 @@ enum {
 	TH_NLA_SOUND,
 	TH_NLA_SOUND_SEL,
 	
-	TH_EMBOSS,
+	TH_WIDGET_EMBOSS,
 
 	TH_AXIS_X,		/* X/Y/Z Axis */
 	TH_AXIS_Y,
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index d6c51b6..645637d 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -761,10 +761,9 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
 			glDrawArrays(GL_QUAD_STRIP, 0, wtb->totvert * 2 + 2);
 
 			/* emboss bottom shadow */
-			UI_GetThemeColor4ubv(TH_EMBOSS, emboss);
-
 			if (wtb->emboss) {
-				UI_GetThemeColor4ubv(TH_EMBOSS, emboss);
+				UI_GetThemeColor4ubv(TH_WIDGET_EMBOSS, emboss);
+
 				if (emboss[3]) {
 					glColor4ubv(emboss);
 					glVertexPointer(2, GL_FLOAT, 0, quad_strip_emboss);
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 945b2f4..a0af914 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -620,8 +620,8 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
 					cp = ts->nla_sound_sel;
 					break;
 					
-				case TH_EMBOSS:
-					cp = btheme->tui.emboss; break;
+				case TH_WIDGET_EMBOSS:
+					cp = btheme->tui.widget_emboss; break;
 
 				case TH_AXIS_X:
 					cp = btheme->tui.xaxis; break;
@@ -821,7 +821,7 @@ void ui_theme_init_default(void)
 	
 	rgba_char_args_set(btheme->tui.wcol_tooltip.text, 255, 255, 255, 255);
 	
-	rgba_char_args_set_fl(btheme->tui.emboss, 1.0f, 1.0f, 1.0f, 0.02f);
+	rgba_char_args_set_fl(btheme->tui.widget_emboss, 1.0f, 1.0f, 1.0f, 0.02f);
 
 	rgba_char_args_set(btheme->tui.xaxis, 220,   0,   0, 255);
 	rgba_char_args_set(btheme->tui.yaxis,   0, 220,   0, 255);
@@ -2499,10 +2499,10 @@ void init_userdef_do_versions(void)
 		}
 	}
 
-	if (U.versionfile < 272 || (U.versionfile == 272 && U.subversionfile < 2)) {
+	if (U.versionfile < 272 || (U.versionfile == 272 && U.subversionfile < 3)) {
 		bTheme *btheme;
 		for (btheme = U.themes.first; btheme; btheme = btheme->next) {
-			rgba_char_args_set_fl(btheme->tui.emboss, 1.0f, 1.0f, 1.0f, 0.02f);
+			rgba_char_args_set_fl(btheme->tui.widget_emboss, 1.0f, 1.0f, 1.0f, 0.02f);
 		}
 	}
 
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index d8653e1..73902e9 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -168,7 +168,7 @@ typedef struct ThemeUI {
 
 	uiPanelColors panel; /* depricated, but we keep it for do_versions (2.66.1) */
 
-	char emboss[4];
+	char widget_emboss[4];
 
 	/* fac: 0 - 1 for blend factor, width in pixels */
 	float menu_shadow_fac;
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index eac1ea9..6519781 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1043,10 +1043,10 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Icon Alpha", "Transparency of icons in the interface, to reduce contrast");
 	RNA_def_property_update(prop, 0, "rna_userdef_update");
 	
-	prop = RNA_def_property(srna, "emboss", PROP_FLOAT, PROP_COLOR_GAMMA);
-	RNA_def_property_float_sdna(prop, NULL, "emboss");
+	prop = RNA_def_property(srna, "widget_emboss", PROP_FLOAT, PROP_COLOR_GAMMA);
+	RNA_def_property_float_sdna(prop, NULL, "widget_emboss");
 	RNA_def_property_array(prop, 4);
-	RNA_def_property_ui_text(prop, "Emboss", "");
+	RNA_def_property_ui_text(prop, "Widget Emboss", "Color of the 1px shadow line underlying widgets");
 	RNA_def_property_update(prop, 0, "rna_userdef_update");
 
 	/* axis */




More information about the Bf-blender-cvs mailing list