diff options
author | julianeisel <julian_eisel@web.de> | 2014-12-08 02:38:36 +0300 |
---|---|---|
committer | julianeisel <julian_eisel@web.de> | 2014-12-08 02:38:36 +0300 |
commit | b88e700df453eba0a512688fba6e25f4cdc3edf0 (patch) | |
tree | 568fa7db7cf645eb56874e1739e8fa60995e7b7b | |
parent | 983c71931b1886d4349b6e964ece4622c8cd74fb (diff) |
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
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 2 | ||||
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 5 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 6 |
6 files changed, 13 insertions, 14 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 82621154450..10394e50581 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 8e37e871501..c3d6dd5da38 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 d6c51b6b220..645637d5130 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 945b2f4e925..a0af914e0bc 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 d8653e1f5fe..73902e9c090 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 eac1ea9f46a..6519781dfd0 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 */ |