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
This commit is contained in:
julianeisel 2014-12-08 00:38:36 +01:00
parent 983c71931b
commit b88e700df4
6 changed files with 13 additions and 14 deletions

View File

@ -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()

View File

@ -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,

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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 */