Commit fb161bab authored by minch's avatar minch Committed by Commit Bot

dark_mode: Set background of DeskNameView inside OnThemeChanged.

This is a revert of the changes of DeskNameView at crrev.com/c/2486781.
Since Textfield::OnThemeChanged SetBackground, we should override it
at DeskNameView::OnThemeChanged to have our own background.

Bug: 1142692
Change-Id: I24b78bd730b010a60180782d646c9b88772123f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2501066Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821773}
parent 092e4d77
...@@ -54,8 +54,6 @@ DeskNameView::DeskNameView() { ...@@ -54,8 +54,6 @@ DeskNameView::DeskNameView() {
SetCursorEnabled(true); SetCursorEnabled(true);
SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_CENTER); SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_CENTER);
SetBackground(views::CreateRoundedRectBackground(GetBackgroundColor(),
kDeskNameViewBorderRadius));
} }
DeskNameView::~DeskNameView() = default; DeskNameView::~DeskNameView() = default;
...@@ -129,6 +127,8 @@ void DeskNameView::OnMouseExited(const ui::MouseEvent& event) { ...@@ -129,6 +127,8 @@ void DeskNameView::OnMouseExited(const ui::MouseEvent& event) {
void DeskNameView::OnThemeChanged() { void DeskNameView::OnThemeChanged() {
Textfield::OnThemeChanged(); Textfield::OnThemeChanged();
SetBackground(views::CreateRoundedRectBackground(GetBackgroundColor(),
kDeskNameViewBorderRadius));
AshColorProvider* color_provider = AshColorProvider::Get(); AshColorProvider* color_provider = AshColorProvider::Get();
const SkColor text_color = color_provider->GetContentLayerColor( const SkColor text_color = color_provider->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary); AshColorProvider::ContentLayerType::kTextColorPrimary);
...@@ -138,7 +138,7 @@ void DeskNameView::OnThemeChanged() { ...@@ -138,7 +138,7 @@ void DeskNameView::OnThemeChanged() {
const SkColor selection_color = color_provider->GetControlsLayerColor( const SkColor selection_color = color_provider->GetControlsLayerColor(
AshColorProvider::ControlsLayerType::kFocusAuraColor); AshColorProvider::ControlsLayerType::kFocusAuraColor);
SetSelectionBackgroundColor(selection_color); SetSelectionBackgroundColor(selection_color);
UpdateViewAppearance(); UpdateBorderState();
} }
views::View* DeskNameView::GetView() { views::View* DeskNameView::GetView() {
......
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