Changeset 4133
- Timestamp:
- Dec 12, 2007, 3:17:33 PM (15 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r4132 r4133 291 291 //set up status bar 292 292 [fStatusBar setHidden: YES]; 293 [fStatusBar setShowOnTiger: YES]; 293 294 294 295 [fTotalDLField setToolTip: NSLocalizedString(@"Total download speed", "Status Bar -> speed tooltip")]; -
trunk/macosx/StatusBarView.h
r4077 r4133 29 29 @interface StatusBarView : NSView 30 30 { 31 NSGradient * fGradient; 31 BOOL fShow; 32 33 CTGradient * fGradient; 32 34 } 33 35 36 - (void) setShowOnTiger: (BOOL) show; 37 34 38 @end -
trunk/macosx/StatusBarView.m
r4077 r4133 25 25 #import "StatusBarView.h" 26 26 #import "NSApplicationAdditions.h" 27 #import "CTGradient.h" 27 28 28 29 @implementation StatusBarView … … 32 33 if ((self = [super initWithFrame: rect])) 33 34 { 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 } 35 fShow = [NSApp isOnLeopardOrBetter]; 36 37 NSColor * startingColor = [NSColor colorWithCalibratedRed: 208.0/255.0 green: 208.0/255.0 blue: 208.0/255.0 alpha: 1.0]; 38 NSColor * endingColor = [NSColor colorWithCalibratedRed: 233.0/255.0 green: 233.0/255.0 blue: 233.0/255.0 alpha: 1.0]; 39 fGradient = [[NSGradient alloc] initWithStartingColor: startingColor endingColor: endingColor]; 40 40 } 41 41 return self; … … 48 48 } 49 49 50 - (void) setShowOnTiger: (BOOL) show 51 { 52 fShow = [NSApp isOnLeopardOrBetter] || show; 53 } 54 50 55 - (BOOL) isOpaque 51 56 { 52 return [NSApp isOnLeopardOrBetter];57 return fShow; 53 58 } 54 59 55 60 - (void) drawRect: (NSRect) rect 56 61 { 57 [fGradient drawInRect: rect angle: 90]; 62 if (fShow) 63 [fGradient drawInRect: rect angle: 90]; 58 64 } 59 65
Note: See TracChangeset
for help on using the changeset viewer.