Commit c50e3d40 authored by Yulun Wu's avatar Yulun Wu Committed by Commit Bot

Update app list folder view colors for light mode.

Bug: 1110766
Change-Id: I2da47ccab1bdb00274ab2224c40efd3a137a5f88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2417241Reviewed-by: default avatarYulun Wu <yulunwu@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808634}
parent 11d47c81
......@@ -88,4 +88,23 @@ SkColor AppListColorProviderImpl::GetSearchBoxIconColor() const {
AshColorProvider::ContentLayerType::kButtonIconColor);
}
SkColor AppListColorProviderImpl::GetFolderBackgroundColor() const {
return ash_color_provider_->GetBaseLayerColor(
AshColorProvider::BaseLayerType::kTransparent80);
}
SkColor AppListColorProviderImpl::GetFolderTitleTextColor() const {
return ash_color_provider_->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary);
}
SkColor AppListColorProviderImpl::GetFolderHintTextColor() const {
return ash_color_provider_->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorSecondary);
}
float AppListColorProviderImpl::GetFolderBackgrounBlurSigma() const {
return static_cast<float>(AshColorProvider::LayerBlurSigma::kBlurDefault);
}
} // namespace ash
......@@ -30,6 +30,10 @@ class AppListColorProviderImpl : public AppListColorProvider {
SkColor GetPageSwitcherInkDropBaseColor() const override;
SkColor GetPageSwitcherInkDropHighlightColor() const override;
SkColor GetSearchBoxIconColor() const override;
SkColor GetFolderBackgroundColor() const override;
SkColor GetFolderTitleTextColor() const override;
SkColor GetFolderHintTextColor() const override;
float GetFolderBackgrounBlurSigma() const override;
private:
// Unowned.
......
......@@ -33,7 +33,7 @@ SkColor TestAppListColorProvider::GetSearchBoxPlaceholderTextColor() const {
}
SkColor TestAppListColorProvider::GetSearchBoxTextColor() const {
return gfx::kGoogleGrey900;
return gfx::kGoogleGrey200;
}
SkColor TestAppListColorProvider::GetSuggestionChipBackgroundColor() const {
......@@ -41,10 +41,14 @@ SkColor TestAppListColorProvider::GetSuggestionChipBackgroundColor() const {
}
SkColor TestAppListColorProvider::GetSuggestionChipTextColor() const {
return gfx::kGoogleGrey900;
return gfx::kGoogleGrey200;
}
SkColor TestAppListColorProvider::GetAppListItemTextColor() const {
return gfx::kGoogleGrey200;
}
SkColor TestAppListColorProvider::GetFolderBackgroundColor() const {
return gfx::kGoogleGrey900;
}
......@@ -64,4 +68,16 @@ SkColor TestAppListColorProvider::GetSearchBoxIconColor() const {
return gfx::kGoogleGrey200;
}
SkColor TestAppListColorProvider::GetFolderTitleTextColor() const {
return gfx::kGoogleGrey200;
}
SkColor TestAppListColorProvider::GetFolderHintTextColor() const {
return gfx::kGoogleGrey500;
}
float TestAppListColorProvider::GetFolderBackgrounBlurSigma() const {
return 30.0f;
}
} // namespace ash
......@@ -30,6 +30,10 @@ class TestAppListColorProvider : public AppListColorProvider {
SkColor GetPageSwitcherInkDropBaseColor() const override;
SkColor GetPageSwitcherInkDropHighlightColor() const override;
SkColor GetSearchBoxIconColor() const override;
SkColor GetFolderBackgroundColor() const override;
SkColor GetFolderTitleTextColor() const override;
SkColor GetFolderHintTextColor() const override;
float GetFolderBackgrounBlurSigma() const override;
};
} // namespace ash
......
......@@ -22,6 +22,7 @@
#include "ash/app_list/views/search_box_view.h"
#include "ash/app_list/views/top_icon_animation_view.h"
#include "ash/keyboard/ui/keyboard_ui_controller.h"
#include "ash/public/cpp/app_list/app_list_color_provider.h"
#include "ash/public/cpp/app_list/app_list_config.h"
#include "ash/public/cpp/app_list/app_list_features.h"
#include "ash/public/cpp/metrics_util.h"
......@@ -90,7 +91,7 @@ class BackgroundAnimation : public AppListFolderView::Animation,
: folder_view_->folder_item_icon_bounds();
to_rect -= background_view_->bounds().OffsetFromOrigin();
const SkColor background_color =
folder_view_->GetAppListConfig().folder_background_color();
AppListColorProvider::Get()->GetFolderBackgroundColor();
const SkColor from_color =
show_ ? folder_view_->GetAppListConfig().folder_bubble_color()
: background_color;
......@@ -99,6 +100,8 @@ class BackgroundAnimation : public AppListFolderView::Animation,
: folder_view_->GetAppListConfig().folder_bubble_color();
background_view_->layer()->SetColor(from_color);
background_view_->layer()->SetBackgroundBlur(
AppListColorProvider::Get()->GetFolderBackgrounBlurSigma());
background_view_->layer()->SetClipRect(from_rect);
background_view_->layer()->SetRoundedCornerRadius(
gfx::RoundedCornersF(from_radius));
......@@ -146,10 +149,10 @@ class FolderItemTitleAnimation : public AppListFolderView::Animation,
animation_(this),
folder_view_(folder_view) {
// Calculate the source and target states.
from_color_ = show_ ? folder_view_->GetAppListConfig().grid_title_color()
from_color_ = show_ ? AppListColorProvider::Get()->GetFolderTitleTextColor()
: SK_ColorTRANSPARENT;
to_color_ = show_ ? SK_ColorTRANSPARENT
: folder_view_->GetAppListConfig().grid_title_color();
: AppListColorProvider::Get()->GetFolderTitleTextColor();
animation_.SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN);
animation_.SetSlideDuration(
......@@ -823,7 +826,7 @@ void AppListFolderView::HideViewImmediately() {
if (activated_folder_item_view) {
activated_folder_item_view->SetIconVisible(true);
activated_folder_item_view->title()->SetEnabledColor(
GetAppListConfig().grid_title_color());
AppListColorProvider::Get()->GetFolderTitleTextColor());
activated_folder_item_view->title()->SetVisible(true);
}
}
......
......@@ -9,6 +9,7 @@
#include "ash/app_list/app_list_util.h"
#include "ash/app_list/model/app_list_folder_item.h"
#include "ash/app_list/views/app_list_folder_view.h"
#include "ash/public/cpp/app_list/app_list_color_provider.h"
#include "ash/public/cpp/app_list/app_list_config.h"
#include "ash/public/cpp/app_list/app_list_features.h"
#include "ash/public/cpp/app_list/app_list_switches.h"
......@@ -29,13 +30,6 @@
namespace ash {
namespace {
constexpr SkColor kFolderNameTextColor = gfx::kGoogleGrey700;
constexpr SkColor kFolderTitleHintTextColor = gfx::kGoogleGrey600;
} // namespace
class FolderHeaderView::FolderNameView : public views::Textfield,
public views::ViewTargeterDelegate {
public:
......@@ -45,8 +39,9 @@ class FolderHeaderView::FolderNameView : public views::Textfield,
// Make folder name font size 14px.
SetFontList(
ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(2));
SetTextColor(kFolderNameTextColor);
set_placeholder_text_color(kFolderTitleHintTextColor);
SetTextColor(AppListColorProvider::Get()->GetFolderTitleTextColor());
set_placeholder_text_color(
AppListColorProvider::Get()->GetFolderHintTextColor());
SetNameViewBorderAndBackground(/*is_active=*/false);
SetEventTargeter(std::make_unique<views::ViewTargeter>(this));
}
......
......@@ -29,6 +29,10 @@ class ASH_PUBLIC_EXPORT AppListColorProvider {
virtual SkColor GetPageSwitcherInkDropBaseColor() const = 0;
virtual SkColor GetPageSwitcherInkDropHighlightColor() const = 0;
virtual SkColor GetSearchBoxIconColor() const = 0;
virtual SkColor GetFolderBackgroundColor() const = 0;
virtual SkColor GetFolderTitleTextColor() const = 0;
virtual SkColor GetFolderHintTextColor() const = 0;
virtual float GetFolderBackgrounBlurSigma() const = 0;
protected:
AppListColorProvider();
......
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