Commit 406b03df authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Remove remaining Windows native light mode non-high-contrast color overrides.

I don't think it makes sense to override a few colors to be Windows-native-y but
not most of them.  Furthermore, the colors used are the return values from
GetSysColor(), which for the majority of our users aren't the colors in native
UI anyway (e.g. a Win 10 File Explorer tree view does not use COLOR_HIGHLIGHT
for selections), so while this looks _different_ than before, it doesn't
particularly look less native.

The main visible effect of this is to replace some bright blue selection colors
(trees, focused tables) with greys.  This increases consistency since we already
use greys in menus (which are more frequently seen).

Bug: 1024091
Change-Id: I38822d3e3972cd077950c4c1ee859da21e73f4cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1931582
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718424}
parent 5295b198
......@@ -568,104 +568,9 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id,
if (color_scheme == ColorScheme::kDefault)
color_scheme = GetDefaultSystemColorScheme();
// Win32 system colors currently don't support Dark Mode. As a result,
// fallback on the Aura colors. Inverted color schemes can be ignored here
// as it's only true when Chrome is running on a high-contrast AND when the
// relative luminance of COLOR_WINDOWTEXT is greater than COLOR_WINDOW (e.g.
// white on black), which is basically like dark mode.
if (color_scheme == ColorScheme::kDark)
return GetAuraColor(color_id, this, color_scheme);
if (color_scheme == ColorScheme::kPlatformHighContrast)
return GetPlatformHighContrastColor(color_id);
/* The following colors are intentionally omitted from the subsequent switch
* in order to allow Aura colors to override native ones.
* TODO(pkasting): Create a complete "native Windows" mapping and then
* determine how, if at all, it should mix with the Aura colors instead of
* overriding haphazardly like this.
case kColorId_ButtonEnabledColor:
case kColorId_ButtonUncheckedColor:
return system_colors_[SystemThemeColor::kButtonText];
case kColorId_LabelEnabledColor:
return system_colors_[SystemThemeColor::kButtonText];
case kColorId_LabelDisabledColor:
return system_colors_[SystemThemeColor::kGrayText];
case kColorId_TextfieldDefaultBackground:
return system_colors_[SystemThemeColor::kWindow];
case kColorId_TextfieldDefaultColor:
return system_colors_[SystemThemeColor::kWindowText];
case kColorId_TextfieldReadOnlyBackground:
return system_colors_[SystemThemeColor::kButtonFace];
case kColorId_TextfieldReadOnlyColor:
return system_colors_[SystemThemeColor::kGrayText];
*/
switch (color_id) {
// Window
case kColorId_WindowBackground:
return system_colors_[SystemThemeColor::kWindow];
// Label
case kColorId_LabelTextSelectionColor:
return system_colors_[SystemThemeColor::kHighlightText];
case kColorId_LabelTextSelectionBackgroundFocused:
return system_colors_[SystemThemeColor::kHighlight];
// Textfield
case kColorId_TextfieldSelectionColor:
return system_colors_[SystemThemeColor::kHighlightText];
case kColorId_TextfieldSelectionBackgroundFocused:
return system_colors_[SystemThemeColor::kHighlight];
// Tooltip
case kColorId_TooltipBackground:
return system_colors_[SystemThemeColor::kWindow];
case kColorId_TooltipText:
return system_colors_[SystemThemeColor::kWindowText];
// Tree
// NOTE: these aren't right for all themes, but as close as I could get.
case kColorId_TreeBackground:
return system_colors_[SystemThemeColor::kWindow];
case kColorId_TreeText:
return system_colors_[SystemThemeColor::kWindowText];
case kColorId_TreeSelectedText:
return system_colors_[SystemThemeColor::kHighlightText];
case kColorId_TreeSelectedTextUnfocused:
return system_colors_[SystemThemeColor::kButtonText];
case kColorId_TreeSelectionBackgroundFocused:
return system_colors_[SystemThemeColor::kHighlight];
case kColorId_TreeSelectionBackgroundUnfocused:
return system_colors_[UsesHighContrastColors()
? SystemThemeColor::kMenuHighlight
: SystemThemeColor::kButtonFace];
// Table
case kColorId_TableBackground:
return system_colors_[SystemThemeColor::kWindow];
case kColorId_TableText:
return system_colors_[SystemThemeColor::kWindowText];
case kColorId_TableSelectedText:
return system_colors_[SystemThemeColor::kHighlightText];
case kColorId_TableSelectedTextUnfocused:
return system_colors_[SystemThemeColor::kButtonText];
case kColorId_TableSelectionBackgroundFocused:
return system_colors_[SystemThemeColor::kHighlight];
case kColorId_TableSelectionBackgroundUnfocused:
return system_colors_[UsesHighContrastColors()
? SystemThemeColor::kMenuHighlight
: SystemThemeColor::kButtonFace];
case kColorId_TableGroupingIndicatorColor:
return system_colors_[SystemThemeColor::kGrayText];
default:
break;
}
return GetAuraColor(color_id, this, color_scheme);
return (color_scheme == ColorScheme::kPlatformHighContrast)
? GetPlatformHighContrastColor(color_id)
: GetAuraColor(color_id, this, color_scheme);
}
SkColor NativeThemeWin::GetPlatformHighContrastColor(ColorId color_id) const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment