Page MenuHome

Add theme option for UI emboss
AbandonedPublic

Authored by Jonathan Williamson (carter2422) on Oct 15 2014, 11:59 PM.

Details

Summary

This adds a theme option for UI emboss style and slightly updates the User Prefereces > Themes > User Interface to reflect it per discussion on T42228. Thanks to @Julian Eisel (Severin) for the helpful walkthrough!

Diff Detail

Repository
rB Blender
Branch
interface/widget-emboss-color

Event Timeline

Jonathan Williamson (carter2422) retitled this revision from to This adds a theme option for UI emboss style and slightly updates the User Prefereces > Themes > User Interface to reflect it per discussion on T42228. Thanks to @severin for the helpful walkthrough!.
Jonathan Williamson (carter2422) retitled this revision from This adds a theme option for UI emboss style and slightly updates the User Prefereces > Themes > User Interface to reflect it per discussion on T42228. Thanks to @severin for the helpful walkthrough! to Add theme option for UI emboss.
  • Replace dummy char with 'pad' per Severin's suggestion.
source/blender/makesdna/DNA_userdef_types.h
172

This isn't really needed, you can just change short pad (line 178) to short pad[3], instead

Looks good!

Commented inline about a compile error.

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

I'm no dev, but I get a build error because of this. (ISO C90 forbids mixed declarations and code)

Declarations should be done at the beginning of the block (line 749, where the loop starts).

Jonathan Williamson (carter2422) edited edge metadata.
  • Move declaration to beginning of loop.
  • Adjust short pad

Thanks for the comments @Julian Eisel (Severin) and @venomgfx. Updated the diff.

Anything else needed @Campbell Barton (campbellbarton)?

Suggest not to draw emboss if alpha == 0

Note, on my system emboss isn't being initialized, probably needs version bump? (all zeros, resetting factory defaults fixes)

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

this can be handled a little smarter...

if (wtb->emboss) {
    UI_GetThemeColor4ubv(TH_EMBOSS, emboss);
    if (emboss[3]) {
        .....glColor4ubv. glVertexPointer, glDrawArrays... etc
    }

Love the idea of using alpha for emboss.

It initalized correctly the first time here, but changing theme or using "Reset to default" changed it to black with 0 alpha (patched on current master / Graph theme).

Jonathan Williamson (carter2422) edited edge metadata.
  • Update widget emboss to only draw if alpha =! to zero

Suggest not to draw emboss if alpha == 0

Note, on my system emboss isn't being initialized, probably needs version bump? (all zeros, resetting factory defaults fixes)

Thanks @Campbell Barton (campbellbarton)! Is that's what you meant for the version bump?

Emboss isn't initialized here, R, G, B & A are set to 0.0.

source/blender/editors/interface/resources.c
2499

I believe you should do the version bump here with "U.subversionfile < 2" instead of "U.subversionfile < 1".
In this case there's already such a loop line 2443.

  • Revert "Update widget emboss to only draw if alpha =! to zero"
  • Fix version and re-add check for alpha on emboss

Emboss isn't initialized here, R, G, B & A are set to 0.0.

Oh right! Fixed now :)