// // P4MenuShadedView.m // P4Menu // // Created by Michael Bishop on 7/5/11. // Copyright 2011 Numerical Garden LLC. All rights reserved. // #import "P4MenuShadedView.h" #import "RRGlossCausticShader.h" #import "RRCausticColorMatcher.h" @implementation P4MenuShadedView - (id)initWithFrame:(NSRect)frame { if (! (self = [super initWithFrame:frame]) ) return nil; _shader = [[RRGlossCausticShader alloc] init]; self.baseColor = [NSColor selectedTextBackgroundColor]; return self; } -(void)dealloc { [_shader release]; [super dealloc]; } - (void)drawRect:(NSRect)dirtyRect { // Shade from the top-left corner of the bounds to the bottom-left. NSRect bounds = [self bounds]; [_shader drawShadingFromPoint:NSMakePoint(NSMinX(bounds), NSMaxY(bounds)) toPoint:NSMakePoint(NSMinX(bounds), NSMinY(bounds)) inContext:[[NSGraphicsContext currentContext] graphicsPort]]; } -(void)setBaseColor:(NSColor *)baseColor { [_shader setNoncausticColor:[[baseColor copy] autorelease]]; [_shader update]; } -(NSColor*)baseColor { return [_shader noncausticColor]; } @end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 20722 | jdputsch | initial branch, prep for -Zapp= support | ||
//guest/michael_bishop/MacMenu/src/P4Menu/Source/P4MenuShadedView.m | |||||
#1 | 8331 | Matt Attaway |
Adding initial version of MacMenu for Perforce MacMenu is a helpful Perforce client that sits in your toolbar. It allows you to run standard Perforce operations on the document that is open the currently active editor/viewer. |