mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Add ability to disable animations.
This commit is contained in:
@@ -40,6 +40,7 @@ ReaderPointer::~ReaderPointer() {
|
||||
namespace {
|
||||
|
||||
AnimationManager *_manager = nullptr;
|
||||
bool AnimationsDisabled = false;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -109,6 +110,14 @@ void registerClipManager(Media::Clip::Manager *manager) {
|
||||
manager->connect(manager, SIGNAL(callback(Media::Clip::Reader*,qint32,qint32)), _manager, SLOT(clipCallback(Media::Clip::Reader*,qint32,qint32)));
|
||||
}
|
||||
|
||||
bool Disabled() {
|
||||
return AnimationsDisabled;
|
||||
}
|
||||
|
||||
void SetDisabled(bool disabled) {
|
||||
AnimationsDisabled = disabled;
|
||||
}
|
||||
|
||||
} // anim
|
||||
|
||||
void BasicAnimation::start() {
|
||||
|
||||
@@ -417,6 +417,9 @@ QPainterPath path(QPointF (&from)[N]) {
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Disabled();
|
||||
void SetDisabled(bool disabled);
|
||||
|
||||
};
|
||||
|
||||
class BasicAnimation;
|
||||
@@ -668,7 +671,7 @@ private:
|
||||
, updateCallback(std::move(updateCallback)) {
|
||||
}
|
||||
void step(float64 ms, bool timer) {
|
||||
auto dt = (ms >= duration) ? 1. : (ms / duration);
|
||||
auto dt = (ms >= duration || anim::Disabled()) ? 1. : (ms / duration);
|
||||
if (dt >= 1) {
|
||||
value.finish();
|
||||
a_animation.stop();
|
||||
|
||||
Reference in New Issue
Block a user