Changeset 4077
- Timestamp:
- Dec 6, 2007, 12:57:10 AM (15 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/StatusBarView.h
r3739 r4077 29 29 @interface StatusBarView : NSView 30 30 { 31 CTGradient * fGradient;31 NSGradient * fGradient; 32 32 } 33 33 -
trunk/macosx/StatusBarView.m
r3750 r4077 24 24 25 25 #import "StatusBarView.h" 26 #import " CTGradient.h"26 #import "NSApplicationAdditions.h" 27 27 28 28 @implementation StatusBarView … … 32 32 if ((self = [super initWithFrame: rect])) 33 33 { 34 NSColor * beginningColor = [NSColor colorWithCalibratedRed: 208.0/255.0 green: 208.0/255.0 blue: 208.0/255.0 alpha: 1.0]; 35 NSColor * endingColor = [NSColor colorWithCalibratedRed: 233.0/255.0 green: 233.0/255.0 blue: 233.0/255.0 alpha: 1.0]; 36 fGradient = [[CTGradient gradientWithBeginningColor: beginningColor endingColor: endingColor] retain]; 34 if ([NSApp isOnLeopardOrBetter]) 35 { 36 NSColor * startingColor = [NSColor colorWithCalibratedRed: 208.0/255.0 green: 208.0/255.0 blue: 208.0/255.0 alpha: 1.0]; 37 NSColor * endingColor = [NSColor colorWithCalibratedRed: 233.0/255.0 green: 233.0/255.0 blue: 233.0/255.0 alpha: 1.0]; 38 fGradient = [[NSGradient alloc] initWithStartingColor: startingColor endingColor: endingColor]; 39 } 37 40 } 38 41 return self; … … 47 50 - (BOOL) isOpaque 48 51 { 49 return YES;52 return [NSApp isOnLeopardOrBetter]; 50 53 } 51 54 52 55 - (void) drawRect: (NSRect) rect 53 56 { 54 [fGradient fillRect: rect angle: 90];57 [fGradient drawInRect: rect angle: 90]; 55 58 } 56 59
Note: See TracChangeset
for help on using the changeset viewer.