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

Side by Side Diff: ui/native_theme/native_theme_mac.mm

Issue 2345183002: Views: Draw Textfield selected text in gray when top-level Widget loses focus.
Patch Set: Fix focus changing to other Views. Created 4 years, 2 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/native_theme/native_theme_mac.h" 5 #include "ui/native_theme/native_theme_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 // Text fields. 205 // Text fields.
206 case kColorId_TextfieldDefaultColor: 206 case kColorId_TextfieldDefaultColor:
207 case kColorId_TextfieldReadOnlyColor: 207 case kColorId_TextfieldReadOnlyColor:
208 return NSSystemColorToSkColor([NSColor textColor]); 208 return NSSystemColorToSkColor([NSColor textColor]);
209 case kColorId_TextfieldDefaultBackground: 209 case kColorId_TextfieldDefaultBackground:
210 case kColorId_TextfieldReadOnlyBackground: 210 case kColorId_TextfieldReadOnlyBackground:
211 return NSSystemColorToSkColor([NSColor textBackgroundColor]); 211 return NSSystemColorToSkColor([NSColor textBackgroundColor]);
212 case kColorId_TextfieldSelectionColor: 212 case kColorId_TextfieldSelectionColor:
213 return NSSystemColorToSkColor([NSColor selectedTextColor]); 213 return NSSystemColorToSkColor([NSColor selectedTextColor]);
214 case kColorId_TextfieldSelectionBackgroundUnfocused:
215 return kUnfocusedSelectedTextBackgroundColor;
214 216
215 // Trees/Tables. For focused text, use the alternate* versions, which 217 // Trees/Tables. For focused text, use the alternate* versions, which
216 // NSColor documents as "the table and list view equivalent to the 218 // NSColor documents as "the table and list view equivalent to the
217 // selectedControlTextColor". 219 // selectedControlTextColor".
218 case kColorId_TreeBackground: 220 case kColorId_TreeBackground:
219 case kColorId_TableBackground: 221 case kColorId_TableBackground:
220 return NSSystemColorToSkColor([NSColor controlBackgroundColor]); 222 return NSSystemColorToSkColor([NSColor controlBackgroundColor]);
221 case kColorId_TreeText: 223 case kColorId_TreeText:
222 case kColorId_TableText: 224 case kColorId_TableText:
223 case kColorId_TableSelectedTextUnfocused: 225 case kColorId_TableSelectedTextUnfocused:
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 canvas->drawDRRect(outer_shape, shape, paint); 428 canvas->drawDRRect(outer_shape, shape, paint);
427 } 429 }
428 430
429 NativeThemeMac::NativeThemeMac() { 431 NativeThemeMac::NativeThemeMac() {
430 } 432 }
431 433
432 NativeThemeMac::~NativeThemeMac() { 434 NativeThemeMac::~NativeThemeMac() {
433 } 435 }
434 436
435 } // namespace ui 437 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698