tweak inspector button drawing to account for black lines

This commit is contained in:
Mitchell Livingston 2011-01-30 19:32:40 +00:00
parent 1b52155954
commit 444847fe35
1 changed files with 8 additions and 6 deletions

View File

@ -63,21 +63,18 @@
[tabImage lockFocus]; [tabImage lockFocus];
NSGradient * gradient;
if (fSelected) if (fSelected)
{ {
NSColor * lightColor = [NSColor colorForControlTint: [NSColor currentControlTint]]; NSColor * lightColor = [NSColor colorForControlTint: [NSColor currentControlTint]];
NSColor * darkColor = [lightColor blendedColorWithFraction: 0.2 ofColor: [NSColor blackColor]]; NSColor * darkColor = [lightColor blendedColorWithFraction: 0.2 ofColor: [NSColor blackColor]];
NSGradient * gradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor]; gradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor];
[gradient drawInRect: tabRect angle: 270.0];
[gradient release];
} }
else else
{ {
NSColor * lightColor = [NSColor colorWithCalibratedRed: 245.0/255.0 green: 245.0/255.0 blue: 245.0/255.0 alpha: 1.0]; NSColor * lightColor = [NSColor colorWithCalibratedRed: 245.0/255.0 green: 245.0/255.0 blue: 245.0/255.0 alpha: 1.0];
NSColor * darkColor = [NSColor colorWithCalibratedRed: 215.0/255.0 green: 215.0/255.0 blue: 215.0/255.0 alpha: 1.0]; NSColor * darkColor = [NSColor colorWithCalibratedRed: 215.0/255.0 green: 215.0/255.0 blue: 215.0/255.0 alpha: 1.0];
NSGradient * gradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor]; gradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor];
[gradient drawInRect: tabRect angle: 270.0];
[gradient release];
} }
[[NSColor grayColor] set]; [[NSColor grayColor] set];
@ -85,6 +82,11 @@
NSRectFill(NSMakeRect(0.0, NSHeight(tabRect) - 1.0, NSWidth(tabRect), 1.0)); NSRectFill(NSMakeRect(0.0, NSHeight(tabRect) - 1.0, NSWidth(tabRect), 1.0));
NSRectFill(NSMakeRect(NSWidth(tabRect) - 1.0, 1.0, NSWidth(tabRect) - 1.0, NSHeight(tabRect) - 2.0)); NSRectFill(NSMakeRect(NSWidth(tabRect) - 1.0, 1.0, NSWidth(tabRect) - 1.0, NSHeight(tabRect) - 2.0));
tabRect = NSMakeRect(0.0, 1.0, NSWidth(tabRect) - 1.0, NSHeight(tabRect) - 2.0);
[gradient drawInRect: tabRect angle: 270.0];
[gradient release];
if (fIcon) if (fIcon)
{ {
const NSSize iconSize = [fIcon size]; const NSSize iconSize = [fIcon size];