twitter-archive / twui

A UI framework for Mac based on Core Animation
Other
2.74k stars 268 forks source link

Appearances #122

Closed avaidyam closed 12 years ago

avaidyam commented 12 years ago

I suggest TwUI have appearance containers, much like iOS, but, function differently than UIAppearance.

The way an appearance container would work, is it would define certain theme colors, fonts, and even drawing and layout blocks. For a control that supports an appearance container, it would have to override its own drawing block/drawRect and layoutSubviews/layout block when you set an appearance container to the object.

A simple example: TUILabel could be assigned an appearance container with a primary color black, a secondary color white, an inset for shadow, and a constraint for its position.

A complex example: a TUIProgressBar could be assigned a whole drawing block for HUD, that would be a simple rounded rectangle, or a drawing block for a cocoa-style animated progress bar.

This is just a proposition, and it's something that would take me a while on my own.