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

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: Refactor to use SelectionController(Delegate). Unfinished! Created 4 years, 1 month 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
« no previous file with comments | « ui/native_theme/native_theme_win.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 52acd96f31a1ff839536db94f1535203059a4a53..31cac0098fbfe5b7c30ef8e777146f6956ab711e 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -553,6 +553,8 @@ 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();
// Tooltip
case kColorId_TooltipBackground:
@@ -573,8 +575,7 @@ 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();
case kColorId_TreeArrow:
return system_colors_[COLOR_WINDOWTEXT];
@@ -590,8 +591,7 @@ 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();
case kColorId_TableGroupingIndicatorColor:
return system_colors_[COLOR_GRAYTEXT];
@@ -1991,6 +1991,11 @@ int NativeThemeWin::GetWindowsState(Part part,
return 0;
}
+SkColor NativeThemeWin::GetUnfocusedSelectionBackgroundColor() const {
+ return system_colors_[IsUsingHighContrastTheme() ? COLOR_MENUHIGHLIGHT
+ : COLOR_BTNFACE];
+}
+
HRESULT NativeThemeWin::GetThemeInt(ThemeName theme,
int part_id,
int state_id,
« no previous file with comments | « ui/native_theme/native_theme_win.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698