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

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

Issue 384115: Mac: Draw download item background like windows does if a theme is installed. (Closed)
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
Index: chrome/browser/cocoa/gradient_button_cell.mm
diff --git a/chrome/browser/cocoa/gradient_button_cell.mm b/chrome/browser/cocoa/gradient_button_cell.mm
index 5a7a08abfdd587ab5a8fefe68cf48b0017e0e3da..6af6689de17b686a3ef26bbb33d296249a8064ae 100644
--- a/chrome/browser/cocoa/gradient_button_cell.mm
+++ b/chrome/browser/cocoa/gradient_button_cell.mm
@@ -165,10 +165,14 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
showHighlightGradient:(BOOL)showHighlightGradient
hoverAlpha:(CGFloat)hoverAlpha
active:(BOOL)active
- cellFrame:(NSRect)cellFrame {
+ cellFrame:(NSRect)cellFrame
+ defaultGradient:(NSGradient*)defaultGradient {
NSImage* backgroundImage =
[theme backgroundImageForStyle:GTMThemeStyleToolBarButton state:YES];
+ if (!defaultGradient)
+ defaultGradient = gradient_;
+
if (backgroundImage) {
NSColor* patternColor = [NSColor colorWithPatternImage:backgroundImage];
[patternColor set];
@@ -209,7 +213,7 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
NSGradient *gradient = nil;
if (hoverAlpha == 0 && !isCustomTheme) {
- gradient = gradient_;
+ gradient = defaultGradient;
} else {
gradient = [self gradientForHoverAlpha:hoverAlpha isThemed:isCustomTheme];
}
@@ -284,7 +288,8 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
showHighlightGradient:[self isHighlighted]
hoverAlpha:[self hoverAlpha]
active:active
- cellFrame:cellFrame];
+ cellFrame:cellFrame
+ defaultGradient:nil];
}
// If this is the left side of a segmented button, draw a slight shadow.
« chrome/browser/cocoa/download_item_cell.mm ('K') | « chrome/browser/cocoa/gradient_button_cell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698