2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Finish animations disabling.

Replace some infinite animations with static layouts.
This commit is contained in:
John Preston
2018-09-20 19:39:59 +03:00
parent f68466b072
commit 1ffbec0215
29 changed files with 410 additions and 155 deletions

View File

@@ -480,8 +480,11 @@ auto MediaView::computeOverviewType() const
}
void MediaView::step_state(TimeMs ms, bool timer) {
if (anim::Disabled()) {
ms += st::mediaviewShowDuration + st::mediaviewHideDuration;
}
bool result = false;
for (Showing::iterator i = _animations.begin(); i != _animations.end();) {
for (auto i = _animations.begin(); i != _animations.end();) {
TimeMs start = i.value();
switch (i.key()) {
case OverLeftNav: update(_leftNav); break;
@@ -584,8 +587,11 @@ void MediaView::step_radial(TimeMs ms, bool timer) {
return;
}
const auto wasAnimating = _radial.animating();
_radial.update(radialProgress(), !radialLoading(), ms + radialTimeShift());
if (timer && (wasAnimating || _radial.animating())) {
const auto updated = _radial.update(
radialProgress(),
!radialLoading(),
ms + radialTimeShift());
if (timer && (wasAnimating || _radial.animating()) && (!anim::Disabled() || updated)) {
update(radialRect());
}
const auto ready = _doc && _doc->loaded();