timthedevguy / BGHUDAppKit

* BGHUDAPPKIT is no longer under development by me, I hope that the community will keep it alive and going as I no longer have time to dedicate to the project** The missing HUD controls. Please scroll down to read the readme file for an important notice concerning the future of BGHUDAppKit. Note that there are multiple versions available, 10.5+, 10.6.7, and now 10.7. As soon as I learn how I'll make these all one code base if possible.
http://www.binarymethod.com/
312 stars 57 forks source link

Controls strip out shadows from attributed strings #11

Closed alinebee closed 14 years ago

alinebee commented 14 years ago

At least BGHUDTextFieldCell and BGHUDButtonCell explicitly strip the NSShadowAttributeName from attributed string values in their draw methods, just before drawing the string. This makes it prohibitively hard to give text a shadowed appearance, either by providing a custom attributed string value or by subclassing the control (without just copy-pasting the entire draw method to implement it.)

A subtle shadow helps labels with no background to stand out on translucent HUD windows, so it seems surprising to explicitly strip out custom shadows. What was the reason for this choice?

For my own project I have added a -textShadow method to BGTheme (which returns nil in the base implementation), and modified BGHUDLabel, BGHUDTextFieldCell and BGHUDButtonCell to use the return value of that when drawing text. I can submit these changes as a patch, if this feature is desired.

timthedevguy commented 14 years ago

I don't remember why I did this....but there was a specific reason, lol. But yes, that is a feature I have thought about on occasion and keep putting aside, so if you would like to submit a patch I would be more than happy to accept it.

timthedevguy commented 14 years ago

I only found that BGHUDButtonCell strips the Shadow, and as far as the reason I can't see why I had removed it, maybe it was something I left in from my testing phase and forgot to remove....I apologize.

timthedevguy commented 14 years ago

Fixes no shadows in BGHUDButtonCell

Thanks for pointing this out. Closed by 6e11a8dddbaa63f0a8851beb7dc581f47bbd4f84