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

Unified Diff: ui/native_theme/native_theme_win.cc

Issue 2345183002: Views: Draw Textfield selected text in gray when top-level Widget loses focus.
Patch Set: Fix up colors for Linux. 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 side-by-side diff with in-line comments
Download patch
Index: ui/native_theme/native_theme_win.cc
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index 674352c4a22f553e26c974d337371fb0efd907dc..04ba377ea413ee9e65070d1099a93f8bfb53dc43 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -146,6 +146,12 @@ class ScopedCreateDCWithBitmap {
DISALLOW_COPY_AND_ASSIGN(ScopedCreateDCWithBitmap);
};
+SkColor GetUnfocusedSelectionBackgroundColor(
tapted 2016/10/24 06:04:16 Can we make this a (const) member function of Nati
Patti Lor 2016/10/27 00:17:27 Done.
+ std::map<int, SkColor> system_colors,
+ bool high_contrast) {
+ return system_colors[high_contrast ? COLOR_MENUHIGHLIGHT : COLOR_BTNFACE];
+}
+
} // namespace
namespace ui {
@@ -563,6 +569,9 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
return system_colors_[COLOR_HIGHLIGHTTEXT];
case kColorId_TextfieldSelectionBackgroundFocused:
return system_colors_[COLOR_HIGHLIGHT];
+ case kColorId_TextfieldSelectionBackgroundUnfocused:
+ return GetUnfocusedSelectionBackgroundColor(system_colors_,
+ IsUsingHighContrastTheme());
// Tooltip
case kColorId_TooltipBackground:
@@ -583,8 +592,8 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
case kColorId_TreeSelectionBackgroundFocused:
return system_colors_[COLOR_HIGHLIGHT];
case kColorId_TreeSelectionBackgroundUnfocused:
- return system_colors_[IsUsingHighContrastTheme() ?
- COLOR_MENUHIGHLIGHT : COLOR_BTNFACE];
+ return GetUnfocusedSelectionBackgroundColor(system_colors_,
+ IsUsingHighContrastTheme());
case kColorId_TreeArrow:
return system_colors_[COLOR_WINDOWTEXT];
@@ -600,8 +609,8 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
case kColorId_TableSelectionBackgroundFocused:
return system_colors_[COLOR_HIGHLIGHT];
case kColorId_TableSelectionBackgroundUnfocused:
- return system_colors_[IsUsingHighContrastTheme() ?
- COLOR_MENUHIGHLIGHT : COLOR_BTNFACE];
+ return GetUnfocusedSelectionBackgroundColor(system_colors_,
+ IsUsingHighContrastTheme());
case kColorId_TableGroupingIndicatorColor:
return system_colors_[COLOR_GRAYTEXT];

Powered by Google App Engine
This is Rietveld 408576698