#include <algorithm>
#include "base/strings/sys_string_conversions.h"
-#include "grit/ui_resources.h"
#include "skia/ext/skia_utils_mac.h"
#include "ui/base/resource/resource_bundle.h"
#import "ui/message_center/cocoa/settings_controller.h"
#include "ui/message_center/message_center_style.h"
+#include "ui/resources/grit/ui_resources.h"
using message_center::settings::kEntryIconSize;
using message_center::settings::kInternalHorizontalSpacing;
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.
@end
@implementation MCSettingsButtonCell
+- (BOOL)isOpaque {
+ return YES;
+}
+
- (void)setExtraImage:(NSImage*)extraImage {
extraImage_.reset([extraImage retain]);
}
@end
@implementation MCSettingsEntryView
-
- (id)initWithController:(MCSettingsController*)controller
notifier:(message_center::Notifier*)notifier
frame:(NSRect)frame
}
if (!checkbox_.get()) {
- checkbox_.reset([[NSButton alloc] initWithFrame:checkboxFrame]);
+ checkbox_.reset([[MCSettingsButton alloc] initWithFrame:checkboxFrame]);
[self addSubview:checkbox_];
} else {
[checkbox_ setFrame:checkboxFrame];