diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-02 14:08:04 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-02 14:08:04 +0000 |
commit | f098c9fba633f92dc3164f6ae96224ddcea39cd4 (patch) | |
tree | f6f99cce4da347ba92c57f095197b59cf26539cb /chrome/browser/cocoa/tab_cell.mm | |
parent | 0203ed716229301ebcd111f799ecf4367f5b437e (diff) | |
download | chromium_src-f098c9fba633f92dc3164f6ae96224ddcea39cd4.zip chromium_src-f098c9fba633f92dc3164f6ae96224ddcea39cd4.tar.gz chromium_src-f098c9fba633f92dc3164f6ae96224ddcea39cd4.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/cocoa/tab_cell.mm')
-rw-r--r-- | chrome/browser/cocoa/tab_cell.mm | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/chrome/browser/cocoa/tab_cell.mm b/chrome/browser/cocoa/tab_cell.mm index a2adf27..23719e8 100644 --- a/chrome/browser/cocoa/tab_cell.mm +++ b/chrome/browser/cocoa/tab_cell.mm @@ -10,38 +10,6 @@ #define CP1_MULTIPLIER 1.0/3.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 - (id)initTextCell:(NSString *)aString { @@ -107,10 +75,12 @@ namespace { [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y)]; [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y + 1)]; + GTMTheme *theme = [GTMTheme defaultTheme]; NSGradient *gradient = nil; if (selected) { - gradient = getGradientForStyle(true, active); + gradient = [theme gradientForStyle:GTMThemeStyleTabBarSelected + active:active]; // Stroke with a translucent black [[NSColor colorWithCalibratedWhite:0.0 alpha:active ? 0.5 : 0.3] set]; [[NSGraphicsContext currentContext] saveGraphicsState]; @@ -120,7 +90,8 @@ namespace { [path fill]; [[NSGraphicsContext currentContext] restoreGraphicsState]; } else { - gradient = getGradientForStyle(false, active); + gradient = [theme gradientForStyle:GTMThemeStyleTabBarDeselected + active:active]; // Stroke with a translucent black [[NSColor colorWithCalibratedWhite:0.0 alpha:active ? 0.3 : 0.1] set]; } |