Changeset 9520


Ignore:
Timestamp:
Nov 14, 2009, 3:17:07 AM (13 years ago)
Author:
livings124
Message:

have status bar drawing occur all at once

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/StatusBarView.m

    r7659 r9520  
    3131    if ((self = [super initWithFrame: rect]))
    3232    {
    33         fGrayBorderColor = [[NSColor colorWithCalibratedRed: 171.0f/255.0f green: 171.0f/255.0f blue: 171.0f/255.0f alpha: 1.0f] retain];
     33        fGrayBorderColor = [[NSColor colorWithCalibratedRed: 171.0/255.0 green: 171.0/255.0 blue: 171.0/255.0 alpha: 1.0] retain];
    3434    }
    3535    return self;
     
    4444- (void) drawRect: (NSRect) rect
    4545{
    46     NSRect lineBorderRect = NSMakeRect(rect.origin.x, [self bounds].size.height - 1.0f, rect.size.width, 1.0f);
     46    NSInteger count = 0;
     47    NSRect gridRects[3];
     48    NSColor * colorRects[3];
     49   
     50    NSRect lineBorderRect = NSMakeRect(NSMinX(rect), NSHeight([self bounds]) - 1.0, NSWidth(rect), 1.0);
    4751    if (NSIntersectsRect(lineBorderRect, rect))
    4852    {
    49         [[NSColor whiteColor] set];
    50         NSRectFill(lineBorderRect);
     53        gridRects[count] = lineBorderRect;
     54        colorRects[count] = [NSColor whiteColor];
     55        ++count;
    5156       
    52         rect.size.height--;
     57        rect.size.height -= 1.0;
    5358    }
    5459   
    55     lineBorderRect.origin.y = 0.0f;
     60    lineBorderRect.origin.y = 0.0;
    5661    if (NSIntersectsRect(lineBorderRect, rect))
    5762    {
    58         [fGrayBorderColor set];
    59         NSRectFill(lineBorderRect);
     63        gridRects[count] = lineBorderRect;
     64        colorRects[count] = fGrayBorderColor;
     65        ++count;
    6066       
    61         rect.origin.y++;
    62         rect.size.height--;
     67        rect.origin.y += 1.0;
     68        rect.size.height -= 1.0;
    6369    }
    6470   
    65     [[NSColor controlColor] set];
    66     NSRectFill(rect);
     71    gridRects[count] = rect;
     72    colorRects[count] = [NSColor controlColor];
     73    ++count;
     74   
     75    NSRectFillListWithColors(gridRects, colorRects, count);
    6776}
    6877
Note: See TracChangeset for help on using the changeset viewer.