Commit 72068429 authored by Tommy C. Li's avatar Tommy C. Li Committed by Commit Bot

[omnibox] Fix Section Headers text color in dark mode

Before this CL, we always set the Headers text color to GoogleGray700.

This is not correct, and this CL fixes it so that it's dynamically
calculated by the theme just like the dimmed results text.

In practice, the result of this calculation is still GoogleGray700 in
the standard light-mode configurations, but is enhanced to be a better
contrast ratio in dark mode.

Bug: 1095205
Change-Id: Ieee2bd1db87b8806cb8cac8dcf0e30cc9859d6df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264765
Auto-Submit: Tommy Li <tommycli@chromium.org>
Reviewed-by: default avatarmanuk hovanesian <manukh@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782093}
parent 47a20fb1
...@@ -48,7 +48,6 @@ class OmniboxRowView::HeaderView : public views::View, ...@@ -48,7 +48,6 @@ class OmniboxRowView::HeaderView : public views::View,
views::style::STYLE_PRIMARY) views::style::STYLE_PRIMARY)
.DeriveWithWeight(gfx::Font::Weight::MEDIUM); .DeriveWithWeight(gfx::Font::Weight::MEDIUM);
header_text_->SetFontList(font); header_text_->SetFontList(font);
header_text_->SetEnabledColor(gfx::kGoogleGrey700);
header_toggle_button_ = header_toggle_button_ =
AddChildView(views::CreateVectorToggleImageButton(this)); AddChildView(views::CreateVectorToggleImageButton(this));
...@@ -145,6 +144,10 @@ class OmniboxRowView::HeaderView : public views::View, ...@@ -145,6 +144,10 @@ class OmniboxRowView::HeaderView : public views::View,
part_state = OmniboxPartState::HOVERED; part_state = OmniboxPartState::HOVERED;
} }
SkColor text_color = GetOmniboxColor(
GetThemeProvider(), OmniboxPart::RESULTS_TEXT_DIMMED, part_state);
header_text_->SetEnabledColor(text_color);
SkColor icon_color = GetOmniboxColor(GetThemeProvider(), SkColor icon_color = GetOmniboxColor(GetThemeProvider(),
OmniboxPart::RESULTS_ICON, part_state); OmniboxPart::RESULTS_ICON, part_state);
header_toggle_button_->set_ink_drop_base_color(icon_color); header_toggle_button_->set_ink_drop_base_color(icon_color);
......
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