Commit bb950a88 authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Windows dark mode: fix button typography, make exclusive with high contrast

Bug: 931359
Change-Id: Id017e32692583f81fb30709bf7d26bb6bd2d731a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506560Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638729}
parent 6f58adaa
......@@ -35,11 +35,11 @@ constexpr char kDefaultMonospacedTypeface[] = "DejaVu Sans Mono";
#endif
constexpr char kUnspecifiedTypeface[] = "";
// If the default foreground color from the native theme isn't black, the rest
// of the Harmony spec isn't going to work. Also skip Harmony if a Windows
// High Contrast theme is enabled. One of the four standard High Contrast themes
// in Windows 10 still has black text, but (since the user wants high contrast)
// the grey text shades in Harmony should not be used.
// If the default foreground color from the native theme isn't black and dark
// mode is not on the rest of the Harmony spec isn't going to work. Also skip
// Harmony if a Windows High Contrast theme is enabled. One of the four standard
// High Contrast themes in Windows 10 still has black text, but (since the user
// wants high contrast) the grey text shades in Harmony should not be used.
bool ShouldIgnoreHarmonySpec(const ui::NativeTheme& theme) {
// Mac provides users limited ways to customize the UI, including dark and
// high contrast modes; all these are addressed elsewhere, so there's no need
......@@ -50,6 +50,8 @@ bool ShouldIgnoreHarmonySpec(const ui::NativeTheme& theme) {
#else
if (theme.UsesHighContrastColors())
return true;
if (theme.SystemDarkModeEnabled())
return false;
// TODO(pbos): Revisit this check. Both GG900 and black are considered
// "default black" as the common theme uses GG900 as primary color.
......
......@@ -587,6 +587,11 @@ bool NativeThemeWin::UsesHighContrastColors() const {
}
bool NativeThemeWin::SystemDarkModeEnabled() const {
// Windows high contrast modes are entirely different themes,
// so let them take priority over dark mode.
// ...unless --force-dark-mode was specified in which case caveat emptor.
if (UsesHighContrastColors() && !NativeTheme::SystemDarkModeEnabled())
return false;
bool fDarkModeEnabled = false;
if (hkcu_themes_regkey_.Valid()) {
DWORD apps_use_light_theme = 1;
......
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