Export gradient cell drawing out of API into a custom block.

No alternated gradient or fallback support yet.
This commit is contained in:
Aditya Nrusimha
2012-10-16 20:02:48 -07:00
parent 27068cbf5b
commit f981326c44
4 changed files with 140 additions and 189 deletions
@@ -29,6 +29,12 @@
self.alternateBackgroundColor = [NSColor colorWithCalibratedWhite:0.92 alpha:1.0f];
self.alternateHighlightColor = [NSColor colorWithCalibratedWhite:0.82 alpha:1.0f];
// By replacing the drawSelectedBackground block, when our state is
// changed to selected, we draw an bottom-up gradient from the
// highlight color to the background color with the selection style.
self.drawSelectedBackground = gradientBackgroundWithAngledPattern(TUITableViewCellGradientPatternBackgroundToHighlight,
self.selectionStyle, 90.0f);
// Instead of using a TUILabel or TUITextField, let's take a little
// course in the art of using a TUITextRenderer. It acts as a simple
// text -> layer rendering mechanism class with tie-ins to TUIView,