mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
minor adjustments to the status bar
This commit is contained in:
parent
51b0bf38cb
commit
5daf7d4938
2 changed files with 21 additions and 7 deletions
|
@ -29,6 +29,9 @@
|
|||
@interface StatusBarView : NSView
|
||||
{
|
||||
BOOL fShow;
|
||||
|
||||
CTGradient * fGradient;
|
||||
NSColor * fGrayBorderColor;
|
||||
}
|
||||
|
||||
- (void) setShowOnTiger: (BOOL) show;
|
||||
|
|
|
@ -33,12 +33,20 @@
|
|||
if ((self = [super initWithFrame: rect]))
|
||||
{
|
||||
fShow = [NSApp isOnLeopardOrBetter];
|
||||
|
||||
#warning possible remove (don't forget import, etc)
|
||||
/*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 = [[CTGradient gradientWithBeginningColor: startingColor endingColor: endingColor] retain];*/
|
||||
|
||||
fGrayBorderColor = [[NSColor colorWithCalibratedRed: 171.0/255.0 green: 171.0/255.0 blue: 171.0/255.0 alpha: 1.0] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[fGrayBorderColor release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -56,21 +64,24 @@
|
|||
{
|
||||
if (fShow)
|
||||
{
|
||||
//[fGradient fillRect: rect angle: 90];
|
||||
[[NSColor controlColor] set];
|
||||
NSRectFill(rect);
|
||||
|
||||
NSRect whiteBorderRect = NSMakeRect([self bounds].origin.x, NSMaxY([self bounds]) - 1, [self bounds].size.width, 1);
|
||||
if (NSIntersectsRect(whiteBorderRect, rect))
|
||||
NSRect bounds = [self bounds];
|
||||
|
||||
NSRect lineBorderRect = NSMakeRect(bounds.origin.x, NSMaxY(bounds) - 1.0, bounds.size.width, 1.0);
|
||||
if (NSIntersectsRect(lineBorderRect, rect))
|
||||
{
|
||||
[[NSColor whiteColor] set];
|
||||
NSRectFill(whiteBorderRect);
|
||||
NSRectFill(lineBorderRect);
|
||||
}
|
||||
|
||||
NSRect grayBorderRect = NSMakeRect([self bounds].origin.x, 0, [self bounds].size.width, 1);
|
||||
if (NSIntersectsRect(grayBorderRect, rect))
|
||||
lineBorderRect.origin.y = 0.0;
|
||||
if (NSIntersectsRect(lineBorderRect, rect))
|
||||
{
|
||||
[[NSColor colorWithCalibratedRed: 188.0/255.0 green: 188.0/255.0 blue: 188.0/255.0 alpha: 1.0] set];
|
||||
NSRectFill(grayBorderRect);
|
||||
[fGrayBorderColor set];
|
||||
NSRectFill(lineBorderRect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue