From 63200afe8ab14639b2d04fe08044ac1950dc3764 Mon Sep 17 00:00:00 2001 From: "viettrungluu@chromium.org" Date: Thu, 19 Nov 2009 01:42:26 +0000 Subject: Mac: Fix regression in NTP detached bookmark bar colours. The regression was caused by r32425. BUG=28203 TEST=Look at NTP detached bookmark bar: it should be medium-ish grey, not black (or is that dark grey)? Review URL: http://codereview.chromium.org/406009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32461 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/bookmark_bar_toolbar_view.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm b/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm index 6ca3f54..b665a29 100644 --- a/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm +++ b/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm @@ -98,7 +98,8 @@ const CGFloat kBorderRadius = 3.0; toolbarColor = nil; if (!toolbarColor) toolbarColor = [NSColor colorWithCalibratedWhite:0.9 alpha:1.0]; - [[toolbarColor colorWithAlphaComponent:morph] set]; // Set with opacity. + CGFloat alpha = morph * [toolbarColor alphaComponent]; + [[toolbarColor colorWithAlphaComponent:alpha] set]; // Set with opacity. [border fill]; // Fade in/out the background. @@ -116,13 +117,16 @@ const CGFloat kBorderRadius = 3.0; NSColor* borderColor = [[self gtm_theme] strokeColorForStyle:GTMThemeStyleToolBarButton state:GTMThemeStateActiveWindow]; - [[borderColor colorWithAlphaComponent:morph] set]; // Set with opacity. + alpha = morph * [borderColor alphaComponent]; + [[borderColor colorWithAlphaComponent:alpha] set]; // Set with opacity. [border stroke]; // Fade in/out the divider. // TODO(viettrungluu): It's not obvious that this divider lines up exactly // with |BackgroundGradientView|'s (in fact, it probably doesn't). - [[[self strokeColor] colorWithAlphaComponent:(1 - morph)] set]; + NSColor* strokeColor = [self strokeColor]; + alpha = (1 - morph) * [strokeColor alphaComponent]; + [[strokeColor colorWithAlphaComponent:alpha] set]; NSBezierPath* divider = [NSBezierPath bezierPath]; NSPoint dividerStart = NSMakePoint(morph * bookmarks::kNTPBookmarkBarPadding + morph * 0.5, -- cgit v1.1