Changeset 11489


Ignore:
Timestamp:
Dec 5, 2010, 7:20:07 PM (11 years ago)
Author:
livings124
Message:

undo the status bar in #3788 for now

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r11453 r11489  
    392392- (void) awakeFromNib
    393393{
    394     [fFilterBar setIsFilter: YES];
    395    
    396394    NSToolbar * toolbar = [[NSToolbar alloc] initWithIdentifier: @"TRMainToolbar"];
    397395    [toolbar setDelegate: self];
     
    423421    [fWindow setContentMinSize: contentMinSize];
    424422    [fWindow setContentBorderThickness: NSMinY([[fTableView enclosingScrollView] frame]) forEdge: NSMinYEdge];
    425     [fWindow setMovableByWindowBackground: YES];
    426423   
    427424    [[fTotalDLField cell] setBackgroundStyle: NSBackgroundStyleRaised];
  • trunk/macosx/StatusBarView.h

    r11456 r11489  
    2727@interface StatusBarView : NSView
    2828{
    29     BOOL fIsFilter;
    30     NSGradient * fInactiveGradient, * fStatusGradient, * fFilterGradient;
    3129    NSColor * fGrayBorderColor;
    3230}
    3331
    34 - (void) setIsFilter: (BOOL) isFilter;
    35 
    3632@end
  • trunk/macosx/StatusBarView.m

    r11456 r11489  
    2525#import "StatusBarView.h"
    2626
    27 @interface StatusBarView (Private)
    28 
    29 - (void) reload;
    30 
    31 @end
    32 
    3327@implementation StatusBarView
    3428
     
    3731    if ((self = [super initWithFrame: rect]))
    3832    {
    39         fIsFilter = NO;
    4033        fGrayBorderColor = [[NSColor colorWithCalibratedRed: 171.0/255.0 green: 171.0/255.0 blue: 171.0/255.0 alpha: 1.0] retain];
    41        
    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];
    48         fStatusGradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor];
    49        
    50         lightColor = [NSColor colorWithCalibratedRed: 235.0/255.0 green: 235.0/255.0 blue: 235.0/255.0 alpha: 1.0];
    51         darkColor = [NSColor colorWithCalibratedRed: 205.0/255.0 green: 205.0/255.0 blue: 205.0/255.0 alpha: 1.0];
    52         fFilterGradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor];
    53        
    54         [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reload)
    55             name: NSWindowDidBecomeMainNotification object: [self window]];
    56         [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reload)
    57             name: NSWindowDidResignMainNotification object: [self window]];
    5834    }
    5935    return self;
     
    6339{
    6440    [fGrayBorderColor release];
    65     [fStatusGradient release];
    66     [fInactiveGradient release];
    67     [fFilterGradient release];
    6841    [super dealloc];
    69 }
    70 
    71 - (BOOL) mouseDownCanMoveWindow
    72 {
    73     return !fIsFilter;
    74 }
    75 
    76 #warning get rid of asap
    77 - (void) setIsFilter: (BOOL) isFilter
    78 {
    79     fIsFilter = isFilter;
    8042}
    8143
    8244- (void) drawRect: (NSRect) rect
    8345{
    84     if (fIsFilter)
     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);
     51    if (NSIntersectsRect(lineBorderRect, rect))
    8552    {
    86         NSInteger count = 0;
    87         NSRect gridRects[2];
    88         NSColor * colorRects[2];
     53        gridRects[count] = lineBorderRect;
     54        colorRects[count] = [NSColor whiteColor];
     55        ++count;
    8956       
    90         NSRect lineBorderRect = NSMakeRect(NSMinX(rect), NSHeight([self bounds]) - 1.0, NSWidth(rect), 1.0);
    91         if ([[self window] isMainWindow])
    92         {
    93             if (NSIntersectsRect(lineBorderRect, rect))
    94             {
    95                 gridRects[count] = lineBorderRect;
    96                 colorRects[count] = [NSColor whiteColor];
    97                 ++count;
    98                
    99                 rect.size.height -= 1.0;
    100             }
    101         }
     57        rect.size.height -= 1.0;
     58    }
     59   
     60    lineBorderRect.origin.y = 0.0;
     61    if (NSIntersectsRect(lineBorderRect, rect))
     62    {
     63        gridRects[count] = lineBorderRect;
     64        colorRects[count] = fGrayBorderColor;
     65        ++count;
    10266       
    103         lineBorderRect.origin.y = 0.0;
    104         if (NSIntersectsRect(lineBorderRect, rect))
    105         {
    106             gridRects[count] = lineBorderRect;
    107             colorRects[count] = [[self window] isMainWindow] ? [NSColor colorWithCalibratedWhite: 0.25 alpha: 1.0]
    108                                     : [NSColor colorWithCalibratedWhite: 0.5 alpha: 1.0];
    109             ++count;
    110            
    111             rect.origin.y += 1.0;
    112             rect.size.height -= 1.0;
    113         }
    114        
    115         NSRectFillListWithColors(gridRects, colorRects, count);
    116        
    117         [fFilterGradient drawInRect: rect angle: 270.0];
     67        rect.origin.y += 1.0;
     68        rect.size.height -= 1.0;
    11869    }
    119     else
    120     {
    121         const BOOL active = [[self window] isMainWindow];
    122        
    123         NSInteger count = 0;
    124         NSRect gridRects[2];
    125         NSColor * colorRects[2];
    126        
    127         NSRect lineBorderRect = NSMakeRect(NSMinX(rect), NSHeight([self bounds]) - 1.0, NSWidth(rect), 1.0);
    128         if (active)
    129         {
    130             if (NSIntersectsRect(lineBorderRect, rect))
    131             {
    132                 gridRects[count] = lineBorderRect;
    133                 colorRects[count] = [NSColor colorWithCalibratedWhite: 0.75 alpha: 1.0];
    134                 ++count;
    135                
    136                 rect.size.height -= 1.0;
    137             }
    138         }
    139        
    140         lineBorderRect.origin.y = 0.0;
    141         if (NSIntersectsRect(lineBorderRect, rect))
    142         {
    143             gridRects[count] = lineBorderRect;
    144             colorRects[count] = [[self window] isMainWindow] ? [NSColor colorWithCalibratedWhite: 0.25 alpha: 1.0]
    145                                     : [NSColor colorWithCalibratedWhite: 0.5 alpha: 1.0];
    146             ++count;
    147            
    148             rect.origin.y += 1.0;
    149             rect.size.height -= 1.0;
    150         }
    151        
    152         if (active)
    153             [fStatusGradient drawInRect: rect angle: 270.0];
    154         else
    155             [fInactiveGradient drawInRect: rect angle: 270.0];
    156        
    157         NSRectFillListWithColors(gridRects, colorRects, count);
    158     }
     70   
     71    gridRects[count] = rect;
     72    colorRects[count] = [NSColor controlColor];
     73    ++count;
     74   
     75    NSRectFillListWithColors(gridRects, colorRects, count);
    15976}
    16077
    16178@end
    162 
    163 @implementation StatusBarView (Private)
    164 
    165 - (void) reload
    166 {
    167     [self setNeedsDisplay: YES];
    168 }
    169 
    170 @end
Note: See TracChangeset for help on using the changeset viewer.