Remove widget emboss
Closed, ResolvedPublic


Currently the embossing of UI widgets is hard-coded, often resulting in bad highlights/shadows in themes. It is particularly noticeable in dark themes.

Per @William Reynish (billrey)'s mockups in T38037, I think it's time we remove the embossing from UI widgets. This use to be an option in the theme preferences, but we are already overloaded with options.

I propose we remove embossing entirely, yielding a more modern, flat UI style that is more easily theme able and clean.

This is actually quite a subtle change in most places. For example, here is the default them with and without embossing:

The change is more noticeable on darker themes, such as Graph:

I am willing/able to undertake this myself. I've already been experimenting with the embossing code and it's not difficult. The main challenge will be cleaning up the various remnants of the now defunct emboss theme option.

This has my support. This would clean the GUI up in dark themes, while not impacting the light themes that much.

Here are a few more screenshots showing with and without embossing. You'll notice that the emboss (or lack there of) is quite subtle in the default theme, but sticks out strongly in the darker Graph theme.

Default theme with emboss:

Default theme without emboss:

Graph theme with emboss:

Graph theme without emboss:


Emboss has a function, it's a way to make the element pop, the reason it doesn't always work now it's because it's hardcoded to white (well, glColor4f(1.0f, 1.0f, 1.0f, 0.02f) )

if (wtb->emboss) {
    glColor4f(1.0f, 1.0f, 1.0f, 0.02f);

So I wouldn't remove it completely, but allow to change it's color/alpha (same we do now with Text Style), so we can make it fit all themes. If its alpha is set to 0, we skip the drawing completely.

Personally, I have it changed to black (glColor4f(0.0f, 0.0f, 0.0f, 0.02f)) to work like a subtle shadow.

Example of emboss turned into black for a subtle drop shadow effect:

(ignore the other UI tweaks in this branch :)

Being able to change the color/alpha of emboss will allow us to keep a *classic* 2.5 (and 2.4!) theme identical as it is now, a flat theme without, and the drop shadow effect if needed. While still taking the OGL advantage of not drawing it in case its alpha is 0.

Think this can work as a theme option without much trouble, then we can propose changing defaults after.

+1 to be theme option (RGBA?), by default to white 1.0f/alpha 0.02f so it doesn't affect the current theme.

That's a good example @Pablo Vazquez (venomgfx).

@Campbell Barton (campbellbarton) didn't it use to be a theme option? Any idea why it was disabled? I seem to remember it not making the leap to 2.5x.

I'll dig in and see if I can make it an option.

It was never really an option IIRC. It's the UI Draw Type setting that allowed different "styles", from which some of them had emboss and some didn't.

Okay I've added a new diff to add the Theme option for the emboss feature. By default it's set to same color as was previously hard-coded.

Note: I had some trouble getting everything to align in the User Preferences. Perhaps @Thomas Dinges (dingto) has some suggestions?