2013-12-21 22:25:18 +00:00
|
|
|
|
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
#include "RikScrollerKnobSlotCell.h"
|
|
|
|
|
|
|
|
@implementation RikScrollerKnobSlotCell
|
|
|
|
|
|
|
|
|
|
|
|
@synthesize horizontal;
|
|
|
|
|
|
|
|
- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
|
|
|
{
|
|
|
|
if (NSIsEmptyRect(cellFrame))
|
|
|
|
return;
|
2013-12-28 14:13:04 +00:00
|
|
|
// cellFrame = NSInsetRect(cellFrame, 1, 1);
|
2013-12-22 14:37:22 +00:00
|
|
|
NSColor * baseColor = [NSColor colorWithCalibratedRed: 0.95
|
|
|
|
green: 0.95
|
|
|
|
blue: 0.95
|
|
|
|
alpha: 1.0];
|
2013-12-28 14:13:04 +00:00
|
|
|
NSColor *shadowColor = [baseColor shadowWithLevel: 0.15];
|
2013-12-21 22:25:18 +00:00
|
|
|
NSGradient* gr = [[NSGradient alloc] initWithColorsAndLocations:
|
|
|
|
shadowColor, 1.0,
|
|
|
|
baseColor, 0.7,
|
|
|
|
baseColor, 0.5,
|
|
|
|
baseColor, 0.3,
|
|
|
|
shadowColor, 0.0,
|
|
|
|
nil];
|
|
|
|
int a = 0;
|
|
|
|
if(horizontal)
|
|
|
|
a = 90;
|
|
|
|
[gr drawInRect: cellFrame angle: a];
|
2013-12-28 14:13:04 +00:00
|
|
|
[shadowColor set];
|
|
|
|
NSFrameRect(cellFrame);
|
2013-12-21 22:25:18 +00:00
|
|
|
}
|
|
|
|
@end
|