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

Update focus/selection for holding space item views.

Per last minute change, selection will no longer have a ring. It will
just be a semi-transparent blue overlay.

Focus ring will more snugly fit the view.

Bug: 1147182
Change-Id: Ib6257dee971d3a3f6d8f11ba663b300e1fb7d1b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628501
Commit-Queue: David Black <dmblack@google.com>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843369}
parent 2649cfa5
......@@ -21,7 +21,7 @@ constexpr int kHoldingSpaceContextMenuMargin = 8;
constexpr int kHoldingSpaceCornerRadius = 8;
constexpr int kHoldingSpaceDownloadsChevronIconSize = 20;
constexpr int kHoldingSpaceDownloadsHeaderSpacing = 16;
constexpr int kHoldingSpaceFocusCornerRadius = 12;
constexpr int kHoldingSpaceFocusCornerRadius = 11;
constexpr int kHoldingSpaceFocusInsets = -4;
constexpr int kHoldingSpaceIconSize = 20;
constexpr gfx::Size kHoldingSpaceScreenCaptureSize(104, 80);
......
......@@ -177,9 +177,7 @@ void HoldingSpaceItemView::Layout() {
}
void HoldingSpaceItemView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
// Inset `bounds` to account for stroke.
gfx::Rect bounds = GetLocalBounds();
bounds.Inset(-gfx::Insets(views::PlatformStyle::kFocusHaloThickness / 2));
// Selection ring.
selected_layer_owner_->layer()->SetBounds(bounds);
......@@ -313,25 +311,16 @@ void HoldingSpaceItemView::OnPaintSelect(gfx::Canvas* canvas, gfx::Size size) {
if (!selected_)
return;
const SkColor color = AshColorProvider::Get()->GetControlsLayerColor(
AshColorProvider::ControlsLayerType::kFocusRingColor);
const SkColor overlay_color =
SkColorSetA(color, kHoldingSpaceSelectedOverlayOpacity * 0xFF);
const SkColor color =
SkColorSetA(AshColorProvider::Get()->GetControlsLayerColor(
AshColorProvider::ControlsLayerType::kFocusRingColor),
kHoldingSpaceSelectedOverlayOpacity * 0xFF);
cc::PaintFlags flags;
flags.setAntiAlias(true);
flags.setColor(overlay_color);
gfx::Rect bounds = gfx::Rect(size);
canvas->DrawRoundRect(bounds, kHoldingSpaceCornerRadius, flags);
flags.setColor(color);
flags.setStrokeWidth(views::PlatformStyle::kFocusHaloThickness);
flags.setStyle(cc::PaintFlags::kStroke_Style);
bounds.Inset(gfx::Insets(flags.getStrokeWidth() / 2));
canvas->DrawRoundRect(bounds, kHoldingSpaceCornerRadius, flags);
canvas->DrawRoundRect(gfx::Rect(size), kHoldingSpaceCornerRadius, flags);
}
void HoldingSpaceItemView::OnPinPressed() {
......
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