aboutsummaryrefslogtreecommitdiff
path: root/libs/installer_fomod/src/scalelabel.h
blob: 4e943c326ebf5ad4664ed74c6fc18daab40cedfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef SCALELABEL_H
#define SCALELABEL_H

#include <QImage>
#include <QLabel>
#include <QMovie>

class ScaleLabel : public QLabel
{
  Q_OBJECT
public:
  explicit ScaleLabel(QWidget* parent = nullptr);

  void setScalableResource(const QString& path);
  void setStatic(bool isStatic);
signals:

public slots:
protected:
  virtual void resizeEvent(QResizeEvent* event);

private:
  void setScalableMovie(const QString& path);
  void setScalableImage(const QString& path);

  QImage m_UnscaledImage;
  QSize m_OriginalMovieSize;
  bool m_isStatic = false;
};

#endif  // SCALELABEL_H