Commit 58293adb authored by sahel's avatar sahel Committed by Commit bot

Overlay scrollbars shouldn't fade out while mouse is over/near.

BUG=669668
TEST=ScrollbarAnimationControllerThinningTest.DontFadeAfterReleasedNear,
ScrollbarAnimationControllerThinningTest.FadeAfterReleasedFar,
ScrollbarAnimationControllerThinningTest.MoveNearAndDontFadeOut,
ScrollbarAnimationControllerThinningTest.MoveOverAndDontFadeOut
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2552813002
Cr-Commit-Position: refs/heads/master@{#437585}
parent db62741d
......@@ -72,7 +72,8 @@ void ScrollbarAnimationControllerThinning::RunAnimationFrame(float progress) {
if (current_animating_property_ == THICKNESS) {
thickness_change_ = NONE;
SetCurrentAnimatingProperty(OPACITY);
PostDelayedAnimationTask(false);
if (!mouse_is_near_scrollbar_)
PostDelayedAnimationTask(false);
}
}
}
......@@ -107,7 +108,6 @@ void ScrollbarAnimationControllerThinning::DidMouseUp() {
StartAnimation();
} else {
SetCurrentAnimatingProperty(OPACITY);
PostDelayedAnimationTask(false);
}
}
......@@ -135,6 +135,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) {
......
......@@ -35,6 +35,7 @@ class CC_EXPORT ScrollbarAnimationControllerThinning
bool mouse_is_near_scrollbar() const { return mouse_is_near_scrollbar_; }
void DidScrollUpdate(bool on_resize) override;
void DidScrollEnd() override;
void DidMouseDown() override;
void DidMouseUp() override;
......
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