| 456 | } |
| 457 | |
| 458 | void ScrubberBase::animateHover(bool entering) { |
| 459 | if (!hover_animation_) { |
| 460 | hover_animation_ = new QVariantAnimation(this); |
| 461 | hover_animation_->setEasingCurve(QEasingCurve::OutCubic); |
| 462 | connect(hover_animation_, &QVariantAnimation::valueChanged, this, [this](const QVariant& v) { |
| 463 | setHoverAlphaInternal(v.toReal()); |
| 464 | }); |
| 465 | } |
| 466 | hover_animation_->stop(); |
| 467 | hover_animation_->setDuration(kHoverFadeMs); |
| 468 | hover_animation_->setStartValue(hover_alpha_); |
| 469 | hover_animation_->setEndValue(entering ? 1.0 : 0.0); |
| 470 | hover_animation_->start(); |
| 471 | } |
| 472 | |
| 473 | } // namespace PJ |