From 503fff454da03704a33e7b7e6affdfed7811edbe Mon Sep 17 00:00:00 2001 From: mkarolin Date: Fri, 5 Nov 2021 13:22:39 -0400 Subject: [PATCH] [Cr96-followup] Fixes Task Manager colors. Fixes brave/brave-browser#19241 - Added table selection and grouping colors overrides - Organized colors by UI elements and alphabetized within Chromium change: https://source.chromium.org/chromium/chromium/src/+/9ff93f5baeaa7e547bc56ca3e00c017f74aa7358 commit 9ff93f5baeaa7e547bc56ca3e00c017f74aa7358 Author: Peter Kasting Date: Wed Sep 15 20:32:00 2021 +0000 Port the majority of ui/views/controls/ to color pipeline. Bug: 1249558 --- chromium_src/ui/color/ui_color_mixer.cc | 54 ++++++++++++++++++++----- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/chromium_src/ui/color/ui_color_mixer.cc b/chromium_src/ui/color/ui_color_mixer.cc index dae2770985a2..a4afbc0fce1e 100644 --- a/chromium_src/ui/color/ui_color_mixer.cc +++ b/chromium_src/ui/color/ui_color_mixer.cc @@ -14,29 +14,63 @@ void AddBraveUiColorMixer(ColorProvider* provider, bool high_contrast) { ColorMixer& mixer = provider->AddMixer(); - // For deprecated kColorId_ButtonEnabledColor - mixer[kColorButtonForeground] = {dark_window ? SK_ColorWHITE - : gfx::kBraveGrey800}; - mixer[kColorButtonForegroundChecked] = {kColorButtonForeground}; - // For deprecated kColorId_ProminentButtonFocusedColor - mixer[kColorButtonBackgroundProminentFocused] = {gfx::kBraveColorBrand}; - // For deprecated kColorId_ProminentButtonColor - mixer[kColorButtonBackgroundProminent] = {gfx::kBraveColorBrand}; + // -------------------------------------------------------------------------- + // Border colors + // -------------------------------------------------------------------------- // For deprecated kColorId_FocusedBorderColor mixer[kColorFocusableBorderFocused] = {gfx::kBraveColorBrand}; + + // -------------------------------------------------------------------------- + // Button colors + // -------------------------------------------------------------------------- + // For deprecated kColorId_ProminentButtonColor + mixer[kColorButtonBackgroundProminent] = {gfx::kBraveColorBrand}; // For deprecated kColorId_ProminentButtonDisabledColor mixer[kColorButtonBackgroundProminentDisabled] = {gfx::kGoogleGrey800}; - // For deprecated kColorId_TextOnProminentButtonColor - mixer[kColorButtonForegroundProminent] = {SK_ColorWHITE}; + // For deprecated kColorId_ProminentButtonFocusedColor + mixer[kColorButtonBackgroundProminentFocused] = {gfx::kBraveColorBrand}; // For deprecated kColorId_ButtonBorderColor // TODO(simonhong): Add this color to palette. mixer[kColorButtonBorder] = {SkColorSetRGB(0xc3, 0xc4, 0xcf)}; + // For deprecated kColorId_ButtonEnabledColor + mixer[kColorButtonForeground] = {dark_window ? SK_ColorWHITE + : gfx::kBraveGrey800}; + mixer[kColorButtonForegroundChecked] = {kColorButtonForeground}; + // For deprecated kColorId_TextOnProminentButtonColor + mixer[kColorButtonForegroundProminent] = {SK_ColorWHITE}; + + // -------------------------------------------------------------------------- + // Label colors + // -------------------------------------------------------------------------- // For deprecated kColorId_LabelEnabledColor mixer[kColorLabelForeground] = {kColorButtonForeground}; + + // -------------------------------------------------------------------------- + // Link colors + // -------------------------------------------------------------------------- // For deprecated kColorId_LinkEnabled & kColorId_LinkPressed mixer[kColorLinkForeground] = {dark_window ? gfx::kBraveColorOrange300 : gfx::kBraveColorBrand}; mixer[kColorLinkForegroundPressed] = {kColorLinkForeground}; + + // -------------------------------------------------------------------------- + // Table colors (e.g. Task Manager) + // -------------------------------------------------------------------------- + // For deprecated kColorId_TableSelectionBackgroundFocused and + // kColorId_TableSelectionBackgroundUnfocused (which were + // AlphaBlend(kColorId_ProminentButtonColor, kColorId_WindowBackground, + // SkAlpha{0x3C})) + mixer[kColorTableBackgroundSelectedFocused] = + AlphaBlend(gfx::kBraveColorBrand, kColorPrimaryBackground, 0x3C); + mixer[kColorTableBackgroundSelectedUnfocused] = { + kColorTableBackgroundSelectedFocused}; + // For deprecated kColorId_TableGroupingIndicatorColor (which was the same as + // kColorId_FocusedBorderColor) + mixer[kColorTableGroupingIndicator] = {gfx::kBraveColorBrand}; + + // -------------------------------------------------------------------------- + // Text colors + // -------------------------------------------------------------------------- // For deprecated kColorId_TextfieldSelectionBackgroundFocused mixer[kColorTextfieldSelectionBackground] = { dark_window ? gfx::kGoogleBlue800 : gfx::kGoogleBlue200};