2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 00:55:12 +00:00

added stickers preview

This commit is contained in:
John Preston
2015-12-07 16:05:00 +03:00
parent 6b565acbd6
commit e312adb786
17 changed files with 448 additions and 129 deletions

View File

@@ -57,7 +57,7 @@ signals:
};
class BackgroundWidget : public QWidget, public Animated {
class BackgroundWidget : public TWidget, public Animated {
Q_OBJECT
public:
@@ -104,3 +104,39 @@ private:
BoxShadow shadow;
};
class StickerPreviewWidget : public TWidget {
Q_OBJECT
public:
StickerPreviewWidget(QWidget *parent);
void paintEvent(QPaintEvent *e);
void resizeEvent(QResizeEvent *e);
bool animStep_shown(float64 ms);
void showPreview(DocumentData *sticker);
void hidePreview();
~StickerPreviewWidget();
private:
QSize currentDimensions() const;
QPixmap currentImage() const;
anim::fvalue a_shown;
Animation _a_shown;
DocumentData *_doc;
enum CacheStatus {
CacheNotLoaded,
CacheThumbLoaded,
CacheLoaded,
};
mutable CacheStatus _cacheStatus;
mutable QPixmap _cache;
};