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

Unified Diff: ui/message_center/cocoa/settings_entry_view.mm

Issue 246433013: Merge 264607 "Fix the remaining subpixel antialiasing bugs in th..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1916/src/
Patch Set: Created 6 years, 8 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 | « ui/message_center/cocoa/settings_controller.mm ('k') | ui/message_center/cocoa/tray_view_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/cocoa/settings_entry_view.mm
===================================================================
--- ui/message_center/cocoa/settings_entry_view.mm (revision 265415)
+++ ui/message_center/cocoa/settings_entry_view.mm (working copy)
@@ -56,6 +56,23 @@
const int kCorrectedEntryRightPadding =
kInternalHorizontalSpacing - kIntrinsicLearnMorePadding;
+////////////////////////////////////////////////////////////////////////////////
+
+@interface MCSettingsButton : NSButton
+@end
+
+@implementation MCSettingsButton
+// drawRect: needs to fill the button with a background, otherwise we don't get
+// subpixel antialiasing.
+- (void)drawRect:(NSRect)dirtyRect {
+ NSColor* color = gfx::SkColorToCalibratedNSColor(
+ message_center::kMessageCenterBackgroundColor);
+ [color set];
+ NSRectFill(dirtyRect);
+ [super drawRect:dirtyRect];
+}
+@end
+
@interface MCSettingsButtonCell : NSButtonCell {
// A checkbox's regular image is the checkmark image. This additional image
// is used for the favicon or app icon shown next to the checkmark.
@@ -65,6 +82,10 @@
@end
@implementation MCSettingsButtonCell
+- (BOOL)isOpaque {
+ return YES;
+}
+
- (void)setExtraImage:(NSImage*)extraImage {
extraImage_.reset([extraImage retain]);
}
@@ -133,7 +154,6 @@
@end
@implementation MCSettingsEntryView
-
- (id)initWithController:(MCSettingsController*)controller
notifier:(message_center::Notifier*)notifier
frame:(NSRect)frame
@@ -218,7 +238,7 @@
}
if (!checkbox_.get()) {
- checkbox_.reset([[NSButton alloc] initWithFrame:checkboxFrame]);
+ checkbox_.reset([[MCSettingsButton alloc] initWithFrame:checkboxFrame]);
[self addSubview:checkbox_];
} else {
[checkbox_ setFrame:checkboxFrame];
« no previous file with comments | « ui/message_center/cocoa/settings_controller.mm ('k') | ui/message_center/cocoa/tray_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698