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

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

Issue 240703004: Fix the remaining subpixel antialiasing bugs in the notification center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/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
Index: ui/message_center/cocoa/settings_entry_view.mm
diff --git a/ui/message_center/cocoa/settings_entry_view.mm b/ui/message_center/cocoa/settings_entry_view.mm
index 0607247f874cfb52844fdbbfd5e3da7b82945306..ae16245d12b6ff60008911c42dc5e87f39531354 100644
--- a/ui/message_center/cocoa/settings_entry_view.mm
+++ b/ui/message_center/cocoa/settings_entry_view.mm
@@ -55,6 +55,21 @@ const int kCorrectedIconTextPadding =
// this metric incorporates the intrinsic learn more blank space to compute it.
const int kCorrectedEntryRightPadding =
kInternalHorizontalSpacing - kIntrinsicLearnMorePadding;
+////////////////////////////////////////////////////////////////////////////////
Robert Sesek 2014/04/17 13:31:51 nit: blank lines around
dewittj 2014/04/17 16:58:57 Done.
+@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
@@ -65,6 +80,10 @@ const int kCorrectedEntryRightPadding =
@end
@implementation MCSettingsButtonCell
+- (BOOL)isOpaque {
+ return YES;
+}
+
- (void)setExtraImage:(NSImage*)extraImage {
extraImage_.reset([extraImage retain]);
}
@@ -133,7 +152,6 @@ const int kCorrectedEntryRightPadding =
@end
@implementation MCSettingsEntryView
-
- (id)initWithController:(MCSettingsController*)controller
notifier:(message_center::Notifier*)notifier
frame:(NSRect)frame
@@ -218,7 +236,7 @@ const int kCorrectedEntryRightPadding =
}
if (!checkbox_.get()) {
- checkbox_.reset([[NSButton alloc] initWithFrame:checkboxFrame]);
+ checkbox_.reset([[MCSettingsButton alloc] initWithFrame:checkboxFrame]);
[self addSubview:checkbox_];
} else {
[checkbox_ setFrame:checkboxFrame];

Powered by Google App Engine
This is Rietveld 408576698