diff options
author | Jonathan Williamson <jonathan@cgcookie.com> | 2014-10-27 20:11:55 +0300 |
---|---|---|
committer | Jonathan Williamson <jonathan@cgcookie.com> | 2014-10-27 20:14:00 +0300 |
commit | 6c2ce7a3828e92083dfdad85eb683f4d27ed852b (patch) | |
tree | d5ed160856a0a1dac8baa100bf5cb2288b2bcd2d /source/blender/editors/interface/interface_widgets.c | |
parent | 9a98fad2e02af95774ae9ed83ad60c8b41c2a03c (diff) |
Add Theme Option for UI Emboss
This adds a theme option for the embossing of UI widgets. By doing this users have much greater flexibility for creating nice themes. Previously many themes (particularly dark ones) looked quite bad due to the very obvious emboss. This made simpler, flat-style themes very challenging.
Closes T42228
Reviewed by @campbellbarton
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index b7e61400cfa..46c2da902fe 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -746,6 +746,8 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) glEnableClientState(GL_VERTEX_ARRAY); for (j = 0; j < WIDGET_AA_JITTER; j++) { + unsigned char emboss[4]; + glTranslatef(jit[j][0], jit[j][1], 0.0f); /* outline */ @@ -753,13 +755,17 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) glVertexPointer(2, GL_FLOAT, 0, quad_strip); glDrawArrays(GL_QUAD_STRIP, 0, wtb->totvert * 2 + 2); - + /* emboss bottom shadow */ - if (wtb->emboss) { - glColor4f(1.0f, 1.0f, 1.0f, 0.02f); + UI_GetThemeColor4ubv(TH_EMBOSS, emboss); - glVertexPointer(2, GL_FLOAT, 0, quad_strip_emboss); - glDrawArrays(GL_QUAD_STRIP, 0, wtb->halfwayvert * 2); + if (wtb->emboss) { + UI_GetThemeColor4ubv(TH_EMBOSS, emboss); + if (emboss[3]) { + glColor4ubv(emboss); + glVertexPointer(2, GL_FLOAT, 0, quad_strip_emboss); + glDrawArrays(GL_QUAD_STRIP, 0, wtb->halfwayvert * 2); + } } glTranslatef(-jit[j][0], -jit[j][1], 0.0f); |