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

Unified Diff: cc/input/scrollbar_animation_controller_thinning.cc

Issue 2552813002: Overlay scrollbars shouldn't fade out while mouse is over/near. (Closed)
Patch Set: unittests polished Created 4 years 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
Index: cc/input/scrollbar_animation_controller_thinning.cc
diff --git a/cc/input/scrollbar_animation_controller_thinning.cc b/cc/input/scrollbar_animation_controller_thinning.cc
index 2006d98fddb44a0779c850a7be0c32edb12c5d1c..c13876e4bc7cd65188cb548d833366df54202106 100644
--- a/cc/input/scrollbar_animation_controller_thinning.cc
+++ b/cc/input/scrollbar_animation_controller_thinning.cc
@@ -72,7 +72,9 @@ void ScrollbarAnimationControllerThinning::RunAnimationFrame(float progress) {
if (current_animating_property_ == THICKNESS) {
thickness_change_ = NONE;
SetCurrentAnimatingProperty(OPACITY);
- PostDelayedAnimationTask(false);
+ if (!mouse_is_near_scrollbar_) {
aelias_OOO_until_Jul13 2016/12/07 22:35:09 nit: no braces for this in Chromium style
+ PostDelayedAnimationTask(false);
+ }
}
}
}
@@ -107,7 +109,6 @@ void ScrollbarAnimationControllerThinning::DidMouseUp() {
StartAnimation();
} else {
SetCurrentAnimatingProperty(OPACITY);
- PostDelayedAnimationTask(false);
}
}
@@ -135,6 +136,18 @@ void ScrollbarAnimationControllerThinning::DidScrollUpdate(bool on_resize) {
ApplyThumbThicknessScale(mouse_is_near_scrollbar_ ? 1.f
: kIdleThicknessScale);
SetCurrentAnimatingProperty(OPACITY);
+
+ // Don't fade out the scrollbar when mouse is near.
+ if (mouse_is_near_scrollbar_)
+ StopAnimation();
+}
+
+void ScrollbarAnimationControllerThinning::DidScrollEnd() {
+ ScrollbarAnimationController::DidScrollEnd();
+
+ // Don't fade out the scrollbar when mouse is near.
+ if (mouse_is_near_scrollbar_)
+ StopAnimation();
}
void ScrollbarAnimationControllerThinning::DidMouseMoveNear(float distance) {
« no previous file with comments | « cc/input/scrollbar_animation_controller_thinning.h ('k') | cc/input/scrollbar_animation_controller_thinning_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698