diff --git a/ui/effects/animation_value.cpp b/ui/effects/animation_value.cpp index f56c8519..3370a8f5 100644 --- a/ui/effects/animation_value.cpp +++ b/ui/effects/animation_value.cpp @@ -14,6 +14,7 @@ namespace anim { namespace { rpl::variable AnimationsDisabled = false; +int SlowMultiplierMinusOne/* = 0*/; } // namespace @@ -76,6 +77,16 @@ void SetDisabled(bool disabled) { AnimationsDisabled = disabled; } +int SlowMultiplier() { + return (SlowMultiplierMinusOne + 1); +} + +void SetSlowMultiplier(int multiplier) { + Expects(multiplier > 0); + + SlowMultiplierMinusOne = multiplier - 1; +} + void DrawStaticLoading( QPainter &p, QRectF rect, diff --git a/ui/effects/animation_value.h b/ui/effects/animation_value.h index 82442276..1b9694b5 100644 --- a/ui/effects/animation_value.h +++ b/ui/effects/animation_value.h @@ -351,6 +351,8 @@ QPainterPath path(QPointF (&from)[N]) { rpl::producer Disables(); bool Disabled(); void SetDisabled(bool disabled); +int SlowMultiplier(); +void SetSlowMultiplier(int multiplier); // 1 - default, 10 - slow x10. void DrawStaticLoading( QPainter &p, diff --git a/ui/effects/animations.h b/ui/effects/animations.h index c7eabf62..57d52d39 100644 --- a/ui/effects/animations.h +++ b/ui/effects/animations.h @@ -410,7 +410,7 @@ inline void Simple::startPrepared( anim::transition transition) { _data->from = _data->value; _data->delta = to - _data->from; - _data->duration = duration; + _data->duration = duration * anim::SlowMultiplier(); _data->transition = transition; _data->animation.start(); }