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

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

Issue 348018: Foo. (Closed)
Patch Set: Created 11 years, 2 months 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 | « chrome/browser/cocoa/gradient_button_cell.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c1a2e95eb9c9d0f8f767e96b81a5b05ce7bc0d12 100644
--- a/chrome/browser/cocoa/gradient_button_cell.mm
+++ b/chrome/browser/cocoa/gradient_button_cell.mm
@@ -343,6 +343,29 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
}
}
+ if ([self title]) {
+ NSColor* textColor = [theme
+ textColorForStyle:GTMThemeStyleBookmarksBarButton
+ state:GTMThemeStateActiveWindow];
+ NSColor* hoverTextColor = [theme
+ textColorForStyle:GTMThemeStyleToolBar
+ state:GTMThemeStateActiveWindow];
+
+ NSColor* color = isMouseInside_
+ ? hoverTextColor : textColor;
+
+ NSDictionary* titleAttributes = [NSDictionary
+ dictionaryWithObjectsAndKeys:
+ color, NSForegroundColorAttributeName,
+ [self font], NSFontAttributeName,
+ nil];
+ NSPoint primaryPos = NSMakePoint(
+ cellFrame.origin.x + 4,
+ cellFrame.origin.y);
+
+ [[self title] drawAtPoint:primaryPos withAttributes:titleAttributes];
+ }
+
CGContextEndTransparencyLayer(context);
[NSGraphicsContext restoreGraphicsState];
} else {
« no previous file with comments | « 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