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

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

Issue 406009: Mac: Fix regression in NTP detached bookmark bar colours. (Closed)
Patch Set: Oops. 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
diff --git a/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm b/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm
index 6ca3f541108406d09ed12a972fb7258c093a7985..b665a29ac97cdb04677d100193a71fb590ac638d 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,
« 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