forked from blue/squawk
message preview refactor, several bugs about label size, animations are now playing in previews
This commit is contained in:
parent
4307262f6e
commit
0d584c5aba
20 changed files with 498 additions and 164 deletions
|
@ -127,12 +127,19 @@ Shared::Global::FileInfo Shared::Global::getFileInfo(const QString& path)
|
|||
FileInfo::Preview p = FileInfo::Preview::none;
|
||||
QSize size;
|
||||
if (big == "image") {
|
||||
if (parts.back() == "gif") {
|
||||
//TODO need to consider GIF as a movie
|
||||
QMovie mov(path);
|
||||
if (mov.isValid()) {
|
||||
p = FileInfo::Preview::animation;
|
||||
} else {
|
||||
p = FileInfo::Preview::picture;
|
||||
}
|
||||
p = FileInfo::Preview::picture;
|
||||
QImage img(path);
|
||||
size = img.size();
|
||||
// } else if (big == "video") {
|
||||
// p = FileInfo::Preview::movie;
|
||||
// QMovie mov(path);
|
||||
// size = mov.scaledSize();
|
||||
// qDebug() << mov.isValid();
|
||||
} else {
|
||||
size = defaultIconFileInfoHeight;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <QMimeDatabase>
|
||||
#include <QFileInfo>
|
||||
#include <QImage>
|
||||
#include <QMovie>
|
||||
#include <QSize>
|
||||
#include <QUrl>
|
||||
#include <QLibrary>
|
||||
|
@ -51,7 +52,7 @@ namespace Shared {
|
|||
enum class Preview {
|
||||
none,
|
||||
picture,
|
||||
movie
|
||||
animation
|
||||
};
|
||||
|
||||
QString name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue