Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Unified Diff: chrome/browser/cocoa/bookmark_bar_toolbar_view.mm

Issue 410002: Merge 32461 - Mac: Fix regression in NTP detached bookmark bar colours.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_bar_toolbar_view.mm
===================================================================
--- chrome/browser/cocoa/bookmark_bar_toolbar_view.mm (revision 32517)
+++ chrome/browser/cocoa/bookmark_bar_toolbar_view.mm (working copy)
@@ -98,7 +98,8 @@
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 @@
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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698