mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
make status bar filled only on 10.5 and greater; use NSGradient instead of CTGradient (since 10.4 support isn't needed for this)
This commit is contained in:
parent
40d5a4a39a
commit
bf3a103a9c
2 changed files with 10 additions and 7 deletions
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
@interface StatusBarView : NSView
|
@interface StatusBarView : NSView
|
||||||
{
|
{
|
||||||
CTGradient * fGradient;
|
NSGradient * fGradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#import "StatusBarView.h"
|
#import "StatusBarView.h"
|
||||||
#import "CTGradient.h"
|
#import "NSApplicationAdditions.h"
|
||||||
|
|
||||||
@implementation StatusBarView
|
@implementation StatusBarView
|
||||||
|
|
||||||
|
@ -31,9 +31,12 @@
|
||||||
{
|
{
|
||||||
if ((self = [super initWithFrame: rect]))
|
if ((self = [super initWithFrame: rect]))
|
||||||
{
|
{
|
||||||
NSColor * beginningColor = [NSColor colorWithCalibratedRed: 208.0/255.0 green: 208.0/255.0 blue: 208.0/255.0 alpha: 1.0];
|
if ([NSApp isOnLeopardOrBetter])
|
||||||
NSColor * endingColor = [NSColor colorWithCalibratedRed: 233.0/255.0 green: 233.0/255.0 blue: 233.0/255.0 alpha: 1.0];
|
{
|
||||||
fGradient = [[CTGradient gradientWithBeginningColor: beginningColor endingColor: endingColor] retain];
|
NSColor * startingColor = [NSColor colorWithCalibratedRed: 208.0/255.0 green: 208.0/255.0 blue: 208.0/255.0 alpha: 1.0];
|
||||||
|
NSColor * endingColor = [NSColor colorWithCalibratedRed: 233.0/255.0 green: 233.0/255.0 blue: 233.0/255.0 alpha: 1.0];
|
||||||
|
fGradient = [[NSGradient alloc] initWithStartingColor: startingColor endingColor: endingColor];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -46,12 +49,12 @@
|
||||||
|
|
||||||
- (BOOL) isOpaque
|
- (BOOL) isOpaque
|
||||||
{
|
{
|
||||||
return YES;
|
return [NSApp isOnLeopardOrBetter];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) drawRect: (NSRect) rect
|
- (void) drawRect: (NSRect) rect
|
||||||
{
|
{
|
||||||
[fGradient fillRect: rect angle: 90];
|
[fGradient drawInRect: rect angle: 90];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue