Index: ui/message_center/cocoa/notification_controller.mm |
diff --git a/ui/message_center/cocoa/notification_controller.mm b/ui/message_center/cocoa/notification_controller.mm |
index 2de141e905a2d84fd59b21b3045138c16247bee3..ee429d78e33b1e5c090f1e3affeec49bebf7e123 100644 |
--- a/ui/message_center/cocoa/notification_controller.mm |
+++ b/ui/message_center/cocoa/notification_controller.mm |
@@ -52,13 +52,31 @@ |
@end |
//////////////////////////////////////////////////////////////////////////////// |
+@interface MCNotificationButton : NSButton |
+@end |
+ |
+@implementation MCNotificationButton |
+// drawRect needs to fill the button with a background, otherwise we don't get |
Robert Sesek
2014/02/04 14:46:09
nit: colon after drawRect:
dewittj
2014/02/04 17:12:06
Done.
|
+// subpixel antialiasing. |
+- (void)drawRect:(NSRect)dirtyRect { |
+ [gfx::SkColorToCalibratedNSColor( |
+ message_center::kNotificationBackgroundColor) set]; |
Robert Sesek
2014/02/04 14:46:09
This is a bit awkward looking. I'd pull the NSColo
dewittj
2014/02/04 17:12:06
Done.
|
+ NSRectFill(dirtyRect); |
+ [super drawRect:dirtyRect]; |
+} |
+@end |
@interface MCNotificationButtonCell : NSButtonCell { |
BOOL hovered_; |
} |
@end |
+//////////////////////////////////////////////////////////////////////////////// |
@implementation MCNotificationButtonCell |
+- (BOOL)isOpaque { |
+ return YES; |
+} |
+ |
- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView*)controlView { |
// Else mouseEntered: and mouseExited: won't be called and hovered_ won't be |
// valid. |
@@ -486,8 +504,8 @@ |
NSRect buttonFrame = frame; |
buttonFrame.origin = NSMakePoint(0, y); |
buttonFrame.size.height = message_center::kButtonHeight; |
- base::scoped_nsobject<NSButton> button( |
- [[NSButton alloc] initWithFrame:buttonFrame]); |
+ base::scoped_nsobject<MCNotificationButton> button( |
+ [[MCNotificationButton alloc] initWithFrame:buttonFrame]); |
base::scoped_nsobject<MCNotificationButtonCell> cell( |
[[MCNotificationButtonCell alloc] |
initTextCell:base::SysUTF16ToNSString(buttonInfo.title)]); |