Commit 981249ba authored by David Black's avatar David Black Committed by Chromium LUCI CQ

Polish holding space images in item chip views.

Addresses two problems:
1. Rendered thumbnails may not have opaque backgrounds which can make
   them look a bit untidy when shown in holding space chip item views.
2. Generic file type icons lack sufficient contrast in some contexts in
   which they are shown (e.g. bubble, shelf preview, etc.).

UX solution:
1. Add white background to holding space images in item chip views.
2. Darken generic file type icons.
3. Revisit later w/ dark/light mode effort.

Bug: 1163702
Change-Id: I32ffea29014073e2e0eac74d3db7635e9071b3c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616752Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#841289}
parent 180f3cc0
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "ash/system/holding_space/holding_space_color_provider_impl.h" #include "ash/system/holding_space/holding_space_color_provider_impl.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ui/gfx/color_palette.h"
namespace ash { namespace ash {
...@@ -18,8 +19,7 @@ SkColor HoldingSpaceColorProviderImpl::GetBackgroundColor() const { ...@@ -18,8 +19,7 @@ SkColor HoldingSpaceColorProviderImpl::GetBackgroundColor() const {
} }
SkColor HoldingSpaceColorProviderImpl::GetFileIconColor() const { SkColor HoldingSpaceColorProviderImpl::GetFileIconColor() const {
return AshColorProvider::Get()->GetContentLayerColor( return gfx::kGoogleGrey700;
AshColorProvider::ContentLayerType::kIconColorPrimary);
} }
} // namespace ash } // namespace ash
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "ash/system/holding_space/holding_space_util.h" #include "ash/system/holding_space/holding_space_util.h"
#include "ui/compositor/paint_recorder.h" #include "ui/compositor/paint_recorder.h"
#include "ui/gfx/skia_paint_util.h" #include "ui/gfx/skia_paint_util.h"
#include "ui/views/background.h"
#include "ui/views/controls/label.h" #include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h" #include "ui/views/layout/fill_layout.h"
...@@ -87,6 +88,15 @@ HoldingSpaceItemChipView::HoldingSpaceItemChipView( ...@@ -87,6 +88,15 @@ HoldingSpaceItemChipView::HoldingSpaceItemChipView(
image_ = AddChildView(std::make_unique<RoundedImageView>( image_ = AddChildView(std::make_unique<RoundedImageView>(
kHoldingSpaceChipIconSize / 2, RoundedImageView::Alignment::kLeading)); kHoldingSpaceChipIconSize / 2, RoundedImageView::Alignment::kLeading));
image_->SetBackground(views::CreateRoundedRectBackground(
SK_ColorWHITE, kHoldingSpaceChipIconSize / 2));
// Subscribe to be notified of changes to `item_`'s image.
image_subscription_ =
item->image().AddImageSkiaChangedCallback(base::BindRepeating(
&HoldingSpaceItemChipView::UpdateImage, base::Unretained(this)));
UpdateImage();
label_and_pin_button_container_ = label_and_pin_button_container_ =
AddChildView(std::make_unique<views::View>()); AddChildView(std::make_unique<views::View>());
...@@ -107,13 +117,6 @@ HoldingSpaceItemChipView::HoldingSpaceItemChipView( ...@@ -107,13 +117,6 @@ HoldingSpaceItemChipView::HoldingSpaceItemChipView(
label_->layer()->SetFillsBoundsOpaquely(false); label_->layer()->SetFillsBoundsOpaquely(false);
label_->layer()->SetMaskLayer(label_mask_layer_owner_->layer()); label_->layer()->SetMaskLayer(label_mask_layer_owner_->layer());
// Subscribe to be notified of changes to `item_`'s image.
image_subscription_ =
item->image().AddImageSkiaChangedCallback(base::BindRepeating(
&HoldingSpaceItemChipView::UpdateImage, base::Unretained(this)));
UpdateImage();
views::View* pin_button_container = views::View* pin_button_container =
label_and_pin_button_container_->AddChildView( label_and_pin_button_container_->AddChildView(
std::make_unique<views::View>()); std::make_unique<views::View>());
......
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