Commit 2c5a1a06 authored by Yulun Wu's avatar Yulun Wu Committed by Commit Bot

Restore classic zero state search box text colors.

This CL addresses changes in:

https://chromium-review.googlesource.com/c/chromium/src/+/2425623

Bug: 1134800
Change-Id: I95d8508a817e2b2d32885db84c5ce5129eee52d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2464443
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816397}
parent f358ad79
...@@ -47,6 +47,10 @@ constexpr SkColor kSelectedColor = SkColorSetARGB(15, 0, 0, 0); ...@@ -47,6 +47,10 @@ constexpr SkColor kSelectedColor = SkColorSetARGB(15, 0, 0, 0);
constexpr SkColor kSearchTextColor = SkColorSetRGB(0x33, 0x33, 0x33); constexpr SkColor kSearchTextColor = SkColorSetRGB(0x33, 0x33, 0x33);
// Color of placeholder text in zero query state.
constexpr SkColor kZeroQuerySearchboxColor =
SkColorSetARGB(0x8A, 0x00, 0x00, 0x00);
} // namespace } // namespace
// A background that paints a solid white rounded rect with a thin grey // A background that paints a solid white rounded rect with a thin grey
...@@ -337,10 +341,13 @@ void SearchBoxViewBase::SetSearchBoxActive(bool active, ...@@ -337,10 +341,13 @@ void SearchBoxViewBase::SetSearchBoxActive(bool active,
is_search_box_active_ = active; is_search_box_active_ = active;
UpdateSearchIcon(); UpdateSearchIcon();
UpdateBackgroundColor(kSearchBoxBackgroundDefault);
search_box_->set_placeholder_text_draw_flags( search_box_->set_placeholder_text_draw_flags(
active ? (base::i18n::IsRTL() ? gfx::Canvas::TEXT_ALIGN_RIGHT active ? (base::i18n::IsRTL() ? gfx::Canvas::TEXT_ALIGN_RIGHT
: gfx::Canvas::TEXT_ALIGN_LEFT) : gfx::Canvas::TEXT_ALIGN_LEFT)
: gfx::Canvas::TEXT_ALIGN_CENTER); : gfx::Canvas::TEXT_ALIGN_CENTER);
search_box_->set_placeholder_text_color(active ? kZeroQuerySearchboxColor
: search_box_color_);
search_box_->SetCursorEnabled(active); search_box_->SetCursorEnabled(active);
if (active) { if (active) {
......
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