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

Remove icon and text shadows from launcher.

UX has indicated that icon/text shadows should be removed from launcher
as they are no longer needed with upcoming theming changes.

Bug: 1134433
Change-Id: I963260e1a4b4fea944d499f85392f8590f10bd45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527606Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828397}
parent 883d73af
...@@ -85,18 +85,6 @@ constexpr SkColor kContextSelectionFolder = ...@@ -85,18 +85,6 @@ constexpr SkColor kContextSelectionFolder =
// The width of the focus ring within a folder. // The width of the focus ring within a folder.
constexpr int kFocusRingWidth = 2; constexpr int kFocusRingWidth = 2;
// The shadow blur of title.
constexpr int kTitleShadowBlur = 28;
// The shadow color of title.
constexpr SkColor kTitleShadowColor = SkColorSetA(SK_ColorBLACK, 82);
// The shadow blur of icon.
constexpr int kIconShadowBlur = 10;
// The shadow color of icon.
constexpr SkColor kIconShadowColor = SkColorSetA(SK_ColorBLACK, 31);
// The size of the notification indicator circle over the size of the icon. // The size of the notification indicator circle over the size of the icon.
constexpr float kNotificationIndicatorWidthRatio = 14.0f / 64.0f; constexpr float kNotificationIndicatorWidthRatio = 14.0f / 64.0f;
...@@ -319,15 +307,6 @@ AppListItemView::AppListItemView(AppsGridView* apps_grid_view, ...@@ -319,15 +307,6 @@ AppListItemView::AppListItemView(AppsGridView* apps_grid_view,
features::IsNotificationIndicatorEnabled()) { features::IsNotificationIndicatorEnabled()) {
SetFocusBehavior(FocusBehavior::ALWAYS); SetFocusBehavior(FocusBehavior::ALWAYS);
if (!is_in_folder && !is_folder_) {
// To display shadow for icon while not affecting the icon's bounds, icon
// shadow is behind the icon.
auto icon_shadow = std::make_unique<views::ImageView>();
icon_shadow->SetCanProcessEventsWithinSubtree(false);
icon_shadow->SetVerticalAlignment(views::ImageView::Alignment::kLeading);
icon_shadow_ = AddChildView(std::move(icon_shadow));
}
auto title = std::make_unique<views::Label>(); auto title = std::make_unique<views::Label>();
title->SetBackgroundColor(SK_ColorTRANSPARENT); title->SetBackgroundColor(SK_ColorTRANSPARENT);
title->SetHandlesTooltips(false); title->SetHandlesTooltips(false);
...@@ -338,14 +317,6 @@ AppListItemView::AppListItemView(AppsGridView* apps_grid_view, ...@@ -338,14 +317,6 @@ AppListItemView::AppListItemView(AppsGridView* apps_grid_view,
? SK_ColorBLACK ? SK_ColorBLACK
: AppListColorProvider::Get()->GetAppListItemTextColor()); : AppListColorProvider::Get()->GetAppListItemTextColor());
if (!is_in_folder) {
gfx::ShadowValues title_shadow = gfx::ShadowValues(
1,
gfx::ShadowValue(gfx::Vector2d(), kTitleShadowBlur, kTitleShadowColor));
title->SetShadows(title_shadow);
title_shadow_margins_ = gfx::ShadowValue::GetMargin(title_shadow);
}
icon_ = AddChildView(std::make_unique<IconImageView>()); icon_ = AddChildView(std::make_unique<IconImageView>());
if (is_folder_) { if (is_folder_) {
...@@ -390,8 +361,6 @@ void AppListItemView::SetIcon(const gfx::ImageSkia& icon) { ...@@ -390,8 +361,6 @@ void AppListItemView::SetIcon(const gfx::ImageSkia& icon) {
// Clear icon and bail out if item icon is empty. // Clear icon and bail out if item icon is empty.
if (icon.isNull()) { if (icon.isNull()) {
icon_->SetImage(nullptr); icon_->SetImage(nullptr);
if (icon_shadow_)
icon_shadow_->SetImage(nullptr);
icon_image_ = gfx::ImageSkia(); icon_image_ = gfx::ImageSkia();
return; return;
} }
...@@ -407,16 +376,6 @@ void AppListItemView::SetIcon(const gfx::ImageSkia& icon) { ...@@ -407,16 +376,6 @@ void AppListItemView::SetIcon(const gfx::ImageSkia& icon) {
icon, skia::ImageOperations::RESIZE_BEST, icon_bounds); icon, skia::ImageOperations::RESIZE_BEST, icon_bounds);
icon_->SetImage(resized); icon_->SetImage(resized);
if (icon_shadow_) {
// Create a shadow for the shown icon.
gfx::ImageSkia shadowed =
gfx::ImageSkiaOperations::CreateImageWithDropShadow(
resized, gfx::ShadowValues(
1, gfx::ShadowValue(gfx::Vector2d(), kIconShadowBlur,
kIconShadowColor)));
icon_shadow_->SetImage(shadowed);
}
if (is_notification_indicator_enabled_ && notification_indicator_) { if (is_notification_indicator_enabled_ && notification_indicator_) {
base::Optional<SkColor> notification_color = base::Optional<SkColor> notification_color =
CalculateNotificationColor(icon_image_); CalculateNotificationColor(icon_image_);
...@@ -770,12 +729,6 @@ void AppListItemView::Layout() { ...@@ -770,12 +729,6 @@ void AppListItemView::Layout() {
GetAppListConfig(), rect, icon_->GetImage().size(), icon_scale_); GetAppListConfig(), rect, icon_->GetImage().size(), icon_scale_);
icon_->SetBoundsRect(icon_bounds); icon_->SetBoundsRect(icon_bounds);
if (icon_shadow_) {
const gfx::Rect icon_shadow_bounds = GetIconBoundsForTargetViewBounds(
GetAppListConfig(), rect, icon_shadow_->size(), icon_scale_);
icon_shadow_->SetBoundsRect(icon_shadow_bounds);
}
gfx::Rect title_bounds = GetTitleBoundsForTargetViewBounds( gfx::Rect title_bounds = GetTitleBoundsForTargetViewBounds(
GetAppListConfig(), rect, title_->GetPreferredSize(), icon_scale_); GetAppListConfig(), rect, title_->GetPreferredSize(), icon_scale_);
if (!apps_grid_view_->is_in_folder()) if (!apps_grid_view_->is_in_folder())
...@@ -1054,8 +1007,6 @@ gfx::ImageSkia AppListItemView::GetIconImage() const { ...@@ -1054,8 +1007,6 @@ gfx::ImageSkia AppListItemView::GetIconImage() const {
void AppListItemView::SetIconVisible(bool visible) { void AppListItemView::SetIconVisible(bool visible) {
icon_->SetVisible(visible); icon_->SetVisible(visible);
if (icon_shadow_)
icon_shadow_->SetVisible(visible);
} }
void AppListItemView::SetDragUIState() { void AppListItemView::SetDragUIState() {
......
...@@ -25,7 +25,6 @@ class SimpleMenuModel; ...@@ -25,7 +25,6 @@ class SimpleMenuModel;
} // namespace ui } // namespace ui
namespace views { namespace views {
class ImageView;
class Label; class Label;
} // namespace views } // namespace views
...@@ -258,7 +257,6 @@ class APP_LIST_EXPORT AppListItemView : public views::Button, ...@@ -258,7 +257,6 @@ class APP_LIST_EXPORT AppListItemView : public views::Button,
AppsGridView* apps_grid_view_; // Parent view, owns this. AppsGridView* apps_grid_view_; // Parent view, owns this.
IconImageView* icon_ = nullptr; // Strongly typed child view. IconImageView* icon_ = nullptr; // Strongly typed child view.
views::Label* title_ = nullptr; // Strongly typed child view. views::Label* title_ = nullptr; // Strongly typed child view.
views::ImageView* icon_shadow_ = nullptr; // Strongly typed child view.
std::unique_ptr<AppListMenuModelAdapter> context_menu_; std::unique_ptr<AppListMenuModelAdapter> context_menu_;
......
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