Page MenuHome

Add theme option to control the color of menu shadows
Needs RevisionPublic

Authored by Ellwood Zwovic (gandalf3) on Aug 22 2014, 4:33 AM.

Details

Summary

This adds an option in user preferences > themes > user interface to control the color of menu shadows.

Thanks to gdh, Severin and ideasman42 for help in irc :)

Diff Detail

Event Timeline

Ellwood Zwovic (gandalf3) retitled this revision from to Add theme option to control the color of menu shadows.Aug 22 2014, 4:33 AM
Ellwood Zwovic (gandalf3) updated this object.
Ellwood Zwovic (gandalf3) updated this revision to Diff 2473.
This comment was removed by Ellwood Zwovic (gandalf3).

Revert mistaken revision

Campbell Barton (campbellbarton) requested changes to this revision.

I don't have a strong opinion here, can you show an example of a theme where this makes a noticeable improvement?

This revision now requires changes to proceed.Sep 22 2014, 5:27 AM

@Campbell Barton (campbellbarton) It's certainly not vital functionality, but rather like being able to adjust the shadows, especially on darker themes.

Here's an image comparing the default with different color shadows in different themes:

I especially like the effect of a subtly colorized shadow on a dark theme, as is done on back to black in the example image.
On the other themes, I experimented with a much brighter shadow on a dark theme and a colorized shadow on a light theme.

It's all very subjective whether these changes "improve" the theme, but at least the user would have the option to make such changes if they want to.

Okay, should be fine then, made some minor notes,

source/blender/editors/include/UI_resources.h
267

rather not call menu shadow, this is use for all kinds of popups right? - TH_UI_SHADOW ok?

source/blender/editors/interface/interface_widgets.c
2027

In this case would use glColor4ub and convert (alphastep * (1.0f - expfac)) * 255.0f

source/blender/makesdna/DNA_userdef_types.h
118

try avoid whitespace changes.

385

again, this change is no use.

Checking again, since we have menu_shadow_width - better stick with menu name

Ellwood Zwovic (gandalf3) updated this revision to Diff 2630.

Removed whitespace and other pointless changes.

Ellwood Zwovic (gandalf3) updated this revision to Diff 2653.

Now the theme controls shadows behind nodes too. This might look a bit odd though, as node shadows are drawn behind the node, whereas menu shadows are completely transparent directly under the menu.

Not sure if this is okay or not, feedback is appreciated :)

Campbell Barton (campbellbarton) requested changes to this revision.
Campbell Barton (campbellbarton) added inline comments.
source/blender/editors/interface/interface_draw.c
1732

Currently none of the other parts of the code use UI_GetTheme, probably this should use TH_MENU_SHADOW

This revision now requires changes to proceed.Oct 23 2014, 12:33 PM
Ellwood Zwovic (gandalf3) edited edge metadata.
Ellwood Zwovic (gandalf3) updated this revision to Diff 2762.

Use different function to get color from themes as requested by @Campbell Barton (campbellbarton)

Julian Eisel (Severin) set the repository for this revision to rB Blender.
Julian Eisel (Severin) updated this revision to Diff 3122.

Review update

I talked about this to the other UI-geeks some weeks ago on IRC. We made the desicion to not allow any new theme options as long as the mess in the theme settings is not cleaned up a bit. However, in this case we could make an exception if the following two targets are met:

  • the color is applied globally, so also for node shadows
  • the color ereases the current shadow factor value (the fac/alpha can then be controlled via the 4. channel of the color value)

In this update I mainly did some minor cleanup and adressed the second point from above (the first one was already addressed in the original patch). The only "major" concern I currently have left is that we're missing a version bump. @Ellwood Zwovic (gandalf3), I'll leave that for you, so I don't steal you all the fun ;) Hint: Look at init_userdef_do_versions() in resources.c.

I've bumped the version, however I can't submit the patch as this revision is no longer in the list of available revisions to update.

Here's the diff anyway:

You need to commandeer back. Sry, can't do that from here

Version bump.

I tested with and without bumping the subversion, and it seems like bumping the subversion is necessary.

Rename menu_shadow to just shadow. Do the same for menu_shadow_width.

Just as a note, our current version code is messed up a bit and I'd like to wait with committing this until that has been fixed. This is partial being discussed on the mailing list, I'll commit fixes for the other part after that.

Campbell Barton (campbellbarton) requested changes to this revision.

Needs updating but we might postpone this one for now.

This revision now requires changes to proceed.Feb 11 2015, 6:53 PM