Changeset 4133


Ignore:
Timestamp:
Dec 12, 2007, 3:17:33 PM (15 years ago)
Author:
livings124
Message:

color the background of the status bar on tiger

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r4132 r4133  
    291291    //set up status bar
    292292    [fStatusBar setHidden: YES];
     293    [fStatusBar setShowOnTiger: YES];
    293294   
    294295    [fTotalDLField setToolTip: NSLocalizedString(@"Total download speed", "Status Bar -> speed tooltip")];
  • trunk/macosx/StatusBarView.h

    r4077 r4133  
    2929@interface StatusBarView : NSView
    3030{
    31     NSGradient * fGradient;
     31    BOOL fShow;
     32   
     33    CTGradient * fGradient;
    3234}
    3335
     36- (void) setShowOnTiger: (BOOL) show;
     37
    3438@end
  • trunk/macosx/StatusBarView.m

    r4077 r4133  
    2525#import "StatusBarView.h"
    2626#import "NSApplicationAdditions.h"
     27#import "CTGradient.h"
    2728
    2829@implementation StatusBarView
     
    3233    if ((self = [super initWithFrame: rect]))
    3334    {
    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];
    4040    }
    4141    return self;
     
    4848}
    4949
     50- (void) setShowOnTiger: (BOOL) show
     51{
     52    fShow = [NSApp isOnLeopardOrBetter] || show;
     53}
     54
    5055- (BOOL) isOpaque
    5156{
    52     return [NSApp isOnLeopardOrBetter];
     57    return fShow;
    5358}
    5459
    5560- (void) drawRect: (NSRect) rect
    5661{
    57     [fGradient drawInRect: rect angle: 90];
     62    if (fShow)
     63        [fGradient drawInRect: rect angle: 90];
    5864}
    5965
Note: See TracChangeset for help on using the changeset viewer.