Changeset 11608


Ignore:
Timestamp:
Dec 30, 2010, 5:36:09 PM (11 years ago)
Author:
livings124
Message:

adjust the status bar's color when inactive

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/StatusBarView.h

    r11507 r11608  
    2828{
    2929    BOOL fIsFilter;
    30     NSGradient * fInactiveGradient, * fStatusGradient, * fFilterGradient;
     30    NSGradient * fStatusGradient, * fFilterGradient;
    3131    NSColor * fGrayBorderColor;
    3232}
  • trunk/macosx/StatusBarView.m

    r11558 r11608  
    4040        fGrayBorderColor = [[NSColor colorWithCalibratedRed: 171.0/255.0 green: 171.0/255.0 blue: 171.0/255.0 alpha: 1.0] retain];
    4141       
    42         NSColor * lightColor = [NSColor colorWithCalibratedRed: 230.0/255.0 green: 230.0/255.0 blue: 230.0/255.0 alpha: 1.0];
    43         NSColor * darkColor = [NSColor colorWithCalibratedRed: 220.0/255.0 green: 220.0/255.0 blue: 220.0/255.0 alpha: 1.0];
    44         fInactiveGradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor];
    45        
    46         lightColor = [NSColor colorWithCalibratedRed: 160.0/255.0 green: 160.0/255.0 blue: 160.0/255.0 alpha: 1.0];
    47         darkColor = [NSColor colorWithCalibratedRed: 155.0/255.0 green: 155.0/255.0 blue: 155.0/255.0 alpha: 1.0];
     42        NSColor * lightColor = [NSColor colorWithCalibratedRed: 160.0/255.0 green: 160.0/255.0 blue: 160.0/255.0 alpha: 1.0];
     43        NSColor * darkColor = [NSColor colorWithCalibratedRed: 155.0/255.0 green: 155.0/255.0 blue: 155.0/255.0 alpha: 1.0];
    4844        fStatusGradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor];
    4945       
     
    6460    [fGrayBorderColor release];
    6561    [fStatusGradient release];
    66     [fInactiveGradient release];
    6762    [fFilterGradient release];
    6863    [super dealloc];
     
    121116       
    122117        NSInteger count = 0;
    123         NSRect gridRects[2];
    124         NSColor * colorRects[2];
     118        NSRect gridRects[active ? 2 : 3];
     119        NSColor * colorRects[active ? 2 : 3];
    125120       
    126121        NSRect lineBorderRect = NSMakeRect(NSMinX(rect), NSHeight([self bounds]) - 1.0, NSWidth(rect), 1.0);
     
    141136        {
    142137            gridRects[count] = lineBorderRect;
    143             colorRects[count] = [[self window] isMainWindow] ? [NSColor colorWithCalibratedWhite: 0.25 alpha: 1.0]
    144                                     : [NSColor colorWithCalibratedWhite: 0.5 alpha: 1.0];
     138            colorRects[count] = active ? [NSColor colorWithCalibratedWhite: 0.25 alpha: 1.0]
     139                                        : [NSColor colorWithCalibratedWhite: 0.5 alpha: 1.0];
    145140            ++count;
    146141           
     
    152147            [fStatusGradient drawInRect: rect angle: 270.0];
    153148        else
    154             [fInactiveGradient drawInRect: rect angle: 270.0];
     149        {
     150            gridRects[count] = rect;
     151            colorRects[count] = [NSColor colorWithCalibratedWhite: 0.85 alpha: 1.0];
     152            ++count;
     153        }
    155154       
    156155        NSRectFillListWithColors(gridRects, colorRects, count);
Note: See TracChangeset for help on using the changeset viewer.