Changeset 4077


Ignore:
Timestamp:
Dec 6, 2007, 12:57:10 AM (15 years ago)
Author:
livings124
Message:

make status bar filled only on 10.5 and greater; use NSGradient instead of CTGradient (since 10.4 support isn't needed for this)

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/StatusBarView.h

    r3739 r4077  
    2929@interface StatusBarView : NSView
    3030{
    31     CTGradient * fGradient;
     31    NSGradient * fGradient;
    3232}
    3333
  • trunk/macosx/StatusBarView.m

    r3750 r4077  
    2424
    2525#import "StatusBarView.h"
    26 #import "CTGradient.h"
     26#import "NSApplicationAdditions.h"
    2727
    2828@implementation StatusBarView
     
    3232    if ((self = [super initWithFrame: rect]))
    3333    {
    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        }
    3740    }
    3841    return self;
     
    4750- (BOOL) isOpaque
    4851{
    49     return YES;
     52    return [NSApp isOnLeopardOrBetter];
    5053}
    5154
    5255- (void) drawRect: (NSRect) rect
    5356{
    54     [fGradient fillRect: rect angle: 90];
     57    [fGradient drawInRect: rect angle: 90];
    5558}
    5659
Note: See TracChangeset for help on using the changeset viewer.