Add option to only play animated images on hover

This commit is contained in:
Nicolas Werner 2021-08-29 15:33:39 +02:00
parent 47c7c4c777
commit 15bf643347
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
5 changed files with 49 additions and 1 deletions

View file

@ -94,8 +94,12 @@ MxcAnimatedImage::startDownload()
buffer.isOpen());
movie.setFormat(mimeType);
movie.setDevice(&buffer);
movie.start();
if (play_)
movie.start();
else
movie.jumpToFrame(0);
emit loadedChanged();
update();
});
};
@ -143,6 +147,9 @@ MxcAnimatedImage::startDownload()
QSGNode *
MxcAnimatedImage::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *)
{
if (!imageDirty)
return oldNode;
imageDirty = false;
QSGImageNode *n = static_cast<QSGImageNode *>(oldNode);
if (!n)