Changeset 12864


Ignore:
Timestamp:
Sep 14, 2011, 3:31:34 AM (7 years ago)
Author:
livings124
Message:

before applying the gradient to the status and filter bars, check that the remaining rect is not empty

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/FilterBarView.m

    r12863 r12864  
    8181    }
    8282   
     83    if (!NSIsEmptyRect(rect))
     84    {
     85        const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
     86        [fGradient drawInRect: gradientRect angle: 270.0];
     87    }
     88   
    8389    NSRectFillListWithColors(gridRects, colorRects, count);
    84    
    85     const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
    86     [fGradient drawInRect: gradientRect angle: 270.0];
    8790}
    8891
  • trunk/macosx/StatusBarView.m

    r12863 r12864  
    100100    }
    101101   
    102     if (active)
     102    if (!NSIsEmptyRect(rect))
    103103    {
    104         const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
    105         [fGradient drawInRect: gradientRect angle: 270.0];
    106     }
    107     else
    108     {
    109         gridRects[count] = rect;
    110         colorRects[count] = [NSColor colorWithCalibratedWhite: 0.85 alpha: 1.0];
    111         ++count;
     104        if (active)
     105        {
     106            const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
     107            [fGradient drawInRect: gradientRect angle: 270.0];
     108        }
     109        else
     110        {
     111            gridRects[count] = rect;
     112            colorRects[count] = [NSColor colorWithCalibratedWhite: 0.85 alpha: 1.0];
     113            ++count;
     114        }
    112115    }
    113116   
Note: See TracChangeset for help on using the changeset viewer.