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

Side by Side Diff: ui/message_center/cocoa/opaque_views.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: Address nits. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/message_center/cocoa/opaque_views.h ('k') | ui/message_center/cocoa/settings_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ui/message_center/cocoa/opaque_views.h"
6
7 @implementation MCDropDown
8 // The view must be opaque to render subpixel antialiasing.
9 - (BOOL)isOpaque {
10 return YES;
11 }
12
13 // The view must also fill its background to render subpixel antialiasing.
14 - (void)drawRect:(NSRect)dirtyRect {
15 [backgroundColor_ set];
16 NSRectFill(dirtyRect);
17 [super drawRect:dirtyRect];
18 }
19
20 - (NSColor*)backgroundColor {
21 return backgroundColor_;
22 }
23
24 - (void)setBackgroundColor:(NSColor*)backgroundColor {
25 backgroundColor_.reset([backgroundColor retain]);
26 }
27 @end
28
29 @implementation MCTextField
30 - (id)initWithFrame:(NSRect)frameRect backgroundColor:(NSColor*)color {
31 self = [self initWithFrame:frameRect];
32 if (self) {
33 [self setBackgroundColor:color];
34 backgroundColor_.reset([color retain]);
35 }
36 return self;
37 }
38
39 - (id)initWithFrame:(NSRect)frameRect {
40 self = [super initWithFrame:frameRect];
41 if (self) {
42 [self setAutoresizingMask:NSViewMinYMargin];
43 [self setBezeled:NO];
44 [self setBordered:NO];
45 [self setEditable:NO];
46 [self setSelectable:NO];
47 [self setDrawsBackground:YES];
48 }
49 return self;
50 }
51
52 // The view must be opaque to render subpixel antialiasing.
53 - (BOOL)isOpaque {
54 return YES;
55 }
56
57 // The view must also fill its background to render subpixel antialiasing.
58 - (void)drawRect:(NSRect)dirtyRect {
59 [backgroundColor_ set];
60 NSRectFill(dirtyRect);
61 [super drawRect:dirtyRect];
62 }
63 @end
OLDNEW
« no previous file with comments | « ui/message_center/cocoa/opaque_views.h ('k') | ui/message_center/cocoa/settings_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698