Commit cd9be775 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Revert "Remove hover on icons in launcher"

This reverts commit 517fd5f9.

Reason for revert:
Speculative; looks like it broke app_list_unittests on cros bots:
https://luci-milo.appspot.com/buildbot/chromium.chromiumos/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/28588
https://luci-milo.appspot.com/buildbot/chromium.memory/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/22655

Original change's description:
> Remove hover on icons in launcher
> 
> Changes:
> Disable ImageShadowAnimator in fullscreen app list mode so that the icon
> will not jump when hovered.
> 
> BUG=748236
> 
> Change-Id: Iba8c0717f7cdb132a28c4c21eb9add81a652e93a
> Reviewed-on: https://chromium-review.googlesource.com/592335
> Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
> Commit-Queue: Weidong Guo <weidongg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#490526}

TBR=stevenjb@chromium.org,weidongg@chromium.org

Change-Id: Ida566f754ff80b698c49a3c1ae6d82c0b098d983
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 748236
Reviewed-on: https://chromium-review.googlesource.com/593108Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490646}
parent 0501161f
...@@ -76,13 +76,10 @@ AppListItemView::AppListItemView(AppsGridView* apps_grid_view, ...@@ -76,13 +76,10 @@ AppListItemView::AppListItemView(AppsGridView* apps_grid_view,
icon_(new views::ImageView), icon_(new views::ImageView),
title_(new views::Label), title_(new views::Label),
progress_bar_(new views::ProgressBar), progress_bar_(new views::ProgressBar),
shadow_animator_(this),
is_fullscreen_app_list_enabled_(features::IsFullscreenAppListEnabled()) { is_fullscreen_app_list_enabled_(features::IsFullscreenAppListEnabled()) {
if (!is_fullscreen_app_list_enabled_) { shadow_animator_.animation()->SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN);
shadow_animator_ = new ImageShadowAnimator(this); shadow_animator_.SetStartAndEndShadows(IconStartShadows(), IconEndShadows());
shadow_animator_->animation()->SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN);
shadow_animator_->SetStartAndEndShadows(IconStartShadows(),
IconEndShadows());
}
icon_->set_can_process_events_within_subtree(false); icon_->set_can_process_events_within_subtree(false);
icon_->SetVerticalAlignment(views::ImageView::LEADING); icon_->SetVerticalAlignment(views::ImageView::LEADING);
...@@ -138,10 +135,7 @@ void AppListItemView::SetIcon(const gfx::ImageSkia& icon) { ...@@ -138,10 +135,7 @@ void AppListItemView::SetIcon(const gfx::ImageSkia& icon) {
icon, icon,
skia::ImageOperations::RESIZE_BEST, skia::ImageOperations::RESIZE_BEST,
gfx::Size(kGridIconDimension, kGridIconDimension))); gfx::Size(kGridIconDimension, kGridIconDimension)));
if (shadow_animator_) shadow_animator_.SetOriginalImage(resized);
shadow_animator_->SetOriginalImage(resized);
else
icon_->SetImage(resized);
} }
void AppListItemView::SetUIState(UIState ui_state) { void AppListItemView::SetUIState(UIState ui_state) {
...@@ -272,15 +266,13 @@ void AppListItemView::ShowContextMenuForView(views::View* source, ...@@ -272,15 +266,13 @@ void AppListItemView::ShowContextMenuForView(views::View* source,
void AppListItemView::StateChanged(ButtonState old_state) { void AppListItemView::StateChanged(ButtonState old_state) {
if (state() == STATE_HOVERED || state() == STATE_PRESSED) { if (state() == STATE_HOVERED || state() == STATE_PRESSED) {
if (shadow_animator_) shadow_animator_.animation()->Show();
shadow_animator_->animation()->Show();
// Show the hover/tap highlight: for tap, lighter highlight replaces darker // Show the hover/tap highlight: for tap, lighter highlight replaces darker
// keyboard selection; for mouse hover, keyboard selection takes precedence. // keyboard selection; for mouse hover, keyboard selection takes precedence.
if (!apps_grid_view_->IsSelectedView(this) || state() == STATE_PRESSED) if (!apps_grid_view_->IsSelectedView(this) || state() == STATE_PRESSED)
SetItemIsHighlighted(true); SetItemIsHighlighted(true);
} else { } else {
if (shadow_animator_) shadow_animator_.animation()->Hide();
shadow_animator_->animation()->Hide();
SetItemIsHighlighted(false); SetItemIsHighlighted(false);
if (item_weak_) if (item_weak_)
item_weak_->set_highlighted(false); item_weak_->set_highlighted(false);
......
...@@ -160,7 +160,7 @@ class APP_LIST_EXPORT AppListItemView : public views::CustomButton, ...@@ -160,7 +160,7 @@ class APP_LIST_EXPORT AppListItemView : public views::CustomButton,
// True if scroll gestures should contribute to dragging. // True if scroll gestures should contribute to dragging.
bool touch_dragging_ = false; bool touch_dragging_ = false;
ImageShadowAnimator* shadow_animator_ = nullptr; ImageShadowAnimator shadow_animator_;
bool is_installing_ = false; bool is_installing_ = false;
bool is_highlighted_ = false; bool is_highlighted_ = false;
......
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