big image preview optimisations, preview positioning fix, memory leaks fix

This commit is contained in:
Blue 2021-05-17 23:32:44 +03:00
parent 721f6daa36
commit ddfaa63a24
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
4 changed files with 43 additions and 20 deletions

View file

@ -29,6 +29,7 @@
#include <QMovie>
#include <QFont>
#include <QFontMetrics>
#include <QImageReader>
#include <shared/global.h>
@ -47,9 +48,9 @@ public:
bool isFileReachable() const;
QSize size() const;
static void initializeFont(const QFont& newFont);
static QSize constrainAttachSize(QSize src, QSize bounds);
static QSize calculateAttachSize(const QString& path, const QRect& bounds);
static bool fontInitialized;
static QFont font;
static QFontMetrics metrics;
@ -59,6 +60,7 @@ private:
void clean();
void applyNewSize();
void applyNewMaxSize();
void handleQMovieError(QImageReader::ImageReaderError error);
private:
Shared::Global::FileInfo info;