Changeset 11489
- Timestamp:
- Dec 5, 2010, 7:20:07 PM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r11453 r11489 392 392 - (void) awakeFromNib 393 393 { 394 [fFilterBar setIsFilter: YES];395 396 394 NSToolbar * toolbar = [[NSToolbar alloc] initWithIdentifier: @"TRMainToolbar"]; 397 395 [toolbar setDelegate: self]; … … 423 421 [fWindow setContentMinSize: contentMinSize]; 424 422 [fWindow setContentBorderThickness: NSMinY([[fTableView enclosingScrollView] frame]) forEdge: NSMinYEdge]; 425 [fWindow setMovableByWindowBackground: YES];426 423 427 424 [[fTotalDLField cell] setBackgroundStyle: NSBackgroundStyleRaised]; -
trunk/macosx/StatusBarView.h
r11456 r11489 27 27 @interface StatusBarView : NSView 28 28 { 29 BOOL fIsFilter;30 NSGradient * fInactiveGradient, * fStatusGradient, * fFilterGradient;31 29 NSColor * fGrayBorderColor; 32 30 } 33 31 34 - (void) setIsFilter: (BOOL) isFilter;35 36 32 @end -
trunk/macosx/StatusBarView.m
r11456 r11489 25 25 #import "StatusBarView.h" 26 26 27 @interface StatusBarView (Private)28 29 - (void) reload;30 31 @end32 33 27 @implementation StatusBarView 34 28 … … 37 31 if ((self = [super initWithFrame: rect])) 38 32 { 39 fIsFilter = NO;40 33 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]];58 34 } 59 35 return self; … … 63 39 { 64 40 [fGrayBorderColor release]; 65 [fStatusGradient release];66 [fInactiveGradient release];67 [fFilterGradient release];68 41 [super dealloc]; 69 }70 71 - (BOOL) mouseDownCanMoveWindow72 {73 return !fIsFilter;74 }75 76 #warning get rid of asap77 - (void) setIsFilter: (BOOL) isFilter78 {79 fIsFilter = isFilter;80 42 } 81 43 82 44 - (void) drawRect: (NSRect) rect 83 45 { 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)) 85 52 { 86 NSInteger count = 0;87 NSRect gridRects[2];88 NSColor * colorRects[2];53 gridRects[count] = lineBorderRect; 54 colorRects[count] = [NSColor whiteColor]; 55 ++count; 89 56 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; 102 66 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; 118 69 } 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); 159 76 } 160 77 161 78 @end 162 163 @implementation StatusBarView (Private)164 165 - (void) reload166 {167 [self setNeedsDisplay: YES];168 }169 170 @end
Note: See TracChangeset
for help on using the changeset viewer.