Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: ui/views/animation/flood_fill_ink_drop_animation.cc

Issue 1757993004: Added ink drop hover/ripple to menu hosting bookmark buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sky@ & varkha@ comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/animation/flood_fill_ink_drop_animation.h ('k') | ui/views/animation/ink_drop_animation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/flood_fill_ink_drop_animation.cc
diff --git a/ui/views/animation/flood_fill_ink_drop_animation.cc b/ui/views/animation/flood_fill_ink_drop_animation.cc
index 77db9b263c3c391496118551825db3e570d089cf..77e091e4e495e6e81961bff87257feeec3d10679 100644
--- a/ui/views/animation/flood_fill_ink_drop_animation.cc
+++ b/ui/views/animation/flood_fill_ink_drop_animation.cc
@@ -158,6 +158,12 @@ FloodFillInkDropAnimation::~FloodFillInkDropAnimation() {
AbortAllAnimations();
}
+void FloodFillInkDropAnimation::SnapToActivated() {
+ InkDropAnimation::SnapToActivated();
+ SetOpacity(kVisibleOpacity);
+ painted_layer_.SetTransform(GetActivatedTargetTransform());
+}
+
ui::Layer* FloodFillInkDropAnimation::GetRootLayer() {
return &root_layer_;
}
@@ -209,7 +215,10 @@ void FloodFillInkDropAnimation::AnimateStateChange(
case InkDropState::QUICK_ACTION: {
DCHECK(old_ink_drop_state == InkDropState::HIDDEN ||
old_ink_drop_state == InkDropState::ACTION_PENDING);
-
+ if (old_ink_drop_state == InkDropState::HIDDEN) {
+ AnimateStateChange(old_ink_drop_state, InkDropState::ACTION_PENDING,
+ animation_observer);
+ }
AnimateToOpacity(kHiddenOpacity,
GetAnimationDuration(QUICK_ACTION_FADE_OUT),
ui::LayerAnimator::ENQUEUE_NEW_ANIMATION,
@@ -240,9 +249,8 @@ void FloodFillInkDropAnimation::AnimateStateChange(
AnimateToOpacity(kVisibleOpacity, GetAnimationDuration(ACTIVATED_FADE_IN),
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
gfx::Tween::EASE_IN, animation_observer);
- const gfx::Transform transform = CalculateTransform(
- CalculateLargestDistanceToCorners(size_, center_point_));
- AnimateToTransform(transform, GetAnimationDuration(ACTIVATED_TRANSFORM),
+ AnimateToTransform(GetActivatedTargetTransform(),
+ GetAnimationDuration(ACTIVATED_TRANSFORM),
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
gfx::Tween::EASE_IN_OUT, animation_observer);
break;
@@ -328,4 +336,9 @@ gfx::Transform FloodFillInkDropAnimation::CalculateTransform(
return transform;
}
+gfx::Transform FloodFillInkDropAnimation::GetActivatedTargetTransform() const {
+ return CalculateTransform(
+ CalculateLargestDistanceToCorners(size_, center_point_));
+}
+
} // namespace views
« no previous file with comments | « ui/views/animation/flood_fill_ink_drop_animation.h ('k') | ui/views/animation/ink_drop_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698