Commit f098c9fb authored by jeremy@chromium.org's avatar jeremy@chromium.org

This reverts 2 CLs that worked around a problem with NSGradient on 10.6,

the underlying issue is fixed in the latest seed so we don't need the workaround anymore:

* r16073 "Fixup colors for inactive tab."
* r15328 "Fixes for 10.6" (only the changes to tab_cell.mm)

Review URL: http://codereview.chromium.org/151197

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19810 0039d316-1c4b-4281-b951-d872f2087c98
parent 0203ed71
...@@ -10,38 +10,6 @@ ...@@ -10,38 +10,6 @@
#define CP1_MULTIPLIER 1.0/3.0 #define CP1_MULTIPLIER 1.0/3.0
#define CP2_MULTIPLIER 3.0/8.0 #define CP2_MULTIPLIER 3.0/8.0
namespace {
NSGradient *getGradientForStyle(bool selected, bool active) {
// Workaround for
// rdar://6857649 - NSGradient fails when using LAB Colorspace
// Once that's fixed we can remove this function and just call through
// to -[GTMTheme gradientForStyle:active:] directly with
// GTMThemeStyleTabBarSelected/GTMThemeStyleTabBarDeselected
NSUInteger startHighlight, endHighlight;
if (selected) {
startHighlight = GTMColorationLightHighlight;
endHighlight = GTMColorationLightMidtone;
} else {
startHighlight = GTMColorationLightShadow;
endHighlight = GTMColorationLightShadow;
}
NSColor *backgroundColor = [[GTMTheme defaultTheme] backgroundColor];
NSColor *startColor = [backgroundColor gtm_colorAdjustedFor:startHighlight
faded:!active];
NSColor *endColor = [backgroundColor gtm_colorAdjustedFor:endHighlight
faded:!active];
NSColorSpace *genericRGB = [NSColorSpace genericRGBColorSpace];
startColor = [startColor colorUsingColorSpace:genericRGB];
endColor = [endColor colorUsingColorSpace:genericRGB];
return [[[NSGradient alloc] initWithStartingColor:startColor
endingColor:endColor]
autorelease];
}
} // namespace
@implementation TabCell @implementation TabCell
- (id)initTextCell:(NSString *)aString { - (id)initTextCell:(NSString *)aString {
...@@ -107,10 +75,12 @@ namespace { ...@@ -107,10 +75,12 @@ namespace {
[path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y)]; [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y)];
[path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y + 1)]; [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y + 1)];
GTMTheme *theme = [GTMTheme defaultTheme];
NSGradient *gradient = nil; NSGradient *gradient = nil;
if (selected) { if (selected) {
gradient = getGradientForStyle(true, active); gradient = [theme gradientForStyle:GTMThemeStyleTabBarSelected
active:active];
// Stroke with a translucent black // Stroke with a translucent black
[[NSColor colorWithCalibratedWhite:0.0 alpha:active ? 0.5 : 0.3] set]; [[NSColor colorWithCalibratedWhite:0.0 alpha:active ? 0.5 : 0.3] set];
[[NSGraphicsContext currentContext] saveGraphicsState]; [[NSGraphicsContext currentContext] saveGraphicsState];
...@@ -120,7 +90,8 @@ namespace { ...@@ -120,7 +90,8 @@ namespace {
[path fill]; [path fill];
[[NSGraphicsContext currentContext] restoreGraphicsState]; [[NSGraphicsContext currentContext] restoreGraphicsState];
} else { } else {
gradient = getGradientForStyle(false, active); gradient = [theme gradientForStyle:GTMThemeStyleTabBarDeselected
active:active];
// Stroke with a translucent black // Stroke with a translucent black
[[NSColor colorWithCalibratedWhite:0.0 alpha:active ? 0.3 : 0.1] set]; [[NSColor colorWithCalibratedWhite:0.0 alpha:active ? 0.3 : 0.1] set];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment