mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
color the background of the status bar on tiger
This commit is contained in:
parent
bc295fe78e
commit
cf4f43f090
3 changed files with 20 additions and 9 deletions
|
@ -290,6 +290,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
|
||||
//set up status bar
|
||||
[fStatusBar setHidden: YES];
|
||||
[fStatusBar setShowOnTiger: YES];
|
||||
|
||||
[fTotalDLField setToolTip: NSLocalizedString(@"Total download speed", "Status Bar -> speed tooltip")];
|
||||
[fTotalULField setToolTip: NSLocalizedString(@"Total upload speed", "Status Bar -> speed tooltip")];
|
||||
|
|
|
@ -28,7 +28,11 @@
|
|||
|
||||
@interface StatusBarView : NSView
|
||||
{
|
||||
NSGradient * fGradient;
|
||||
BOOL fShow;
|
||||
|
||||
CTGradient * fGradient;
|
||||
}
|
||||
|
||||
- (void) setShowOnTiger: (BOOL) show;
|
||||
|
||||
@end
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#import "StatusBarView.h"
|
||||
#import "NSApplicationAdditions.h"
|
||||
#import "CTGradient.h"
|
||||
|
||||
@implementation StatusBarView
|
||||
|
||||
|
@ -31,12 +32,11 @@
|
|||
{
|
||||
if ((self = [super initWithFrame: rect]))
|
||||
{
|
||||
if ([NSApp isOnLeopardOrBetter])
|
||||
{
|
||||
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];
|
||||
}
|
||||
fShow = [NSApp isOnLeopardOrBetter];
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -47,14 +47,20 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) setShowOnTiger: (BOOL) show
|
||||
{
|
||||
fShow = [NSApp isOnLeopardOrBetter] || show;
|
||||
}
|
||||
|
||||
- (BOOL) isOpaque
|
||||
{
|
||||
return [NSApp isOnLeopardOrBetter];
|
||||
return fShow;
|
||||
}
|
||||
|
||||
- (void) drawRect: (NSRect) rect
|
||||
{
|
||||
[fGradient drawInRect: rect angle: 90];
|
||||
if (fShow)
|
||||
[fGradient drawInRect: rect angle: 90];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue