Commit 9e626dbc authored by Manu Cornet's avatar Manu Cornet Committed by Commit Bot

CrOS shelf: Fix button highlight size

This makes sure that the size of the highlight (which is also
the 'small' part of the ripple animation) corresponds to the shelf
size.

This results in no behavior change in the old UI, and fixes a glitch
in the new one.

Bug: 877563
Change-Id: I93c0fa90e22ded53e77b2b099e852851821f62a1
Reviewed-on: https://chromium-review.googlesource.com/1189186Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586293}
parent 1db5bf4f
......@@ -46,8 +46,7 @@ constexpr int kNotificationIndicatorRadiusDip = 7;
constexpr SkColor kIndicatorBorderColor = SkColorSetA(SK_ColorBLACK, 0x4D);
constexpr SkColor kIndicatorColor = SK_ColorWHITE;
// Shelf item ripple constants.
constexpr int kInkDropSmallSize = 48;
// Shelf item ripple size.
constexpr int kInkDropLargeSize = 60;
// The time threshold before an item can be dragged.
......@@ -685,10 +684,11 @@ void ShelfButton::OnGestureEvent(ui::GestureEvent* event) {
}
std::unique_ptr<views::InkDropRipple> ShelfButton::CreateInkDropRipple() const {
const int ink_drop_small_size = ash::ShelfConstants::shelf_size();
return std::make_unique<views::SquareInkDropRipple>(
gfx::Size(kInkDropLargeSize, kInkDropLargeSize),
ink_drop_large_corner_radius(),
gfx::Size(kInkDropSmallSize, kInkDropSmallSize),
gfx::Size(ink_drop_small_size, ink_drop_small_size),
ink_drop_small_corner_radius(), GetLocalBounds().CenterPoint(),
GetInkDropBaseColor(), ink_drop_visible_opacity());
}
......
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