comparison include/gui/widgets/poster.h @ 83:d02fdf1d6708

*: huuuge update 1. make the now playing page function correctly 2. de-constructorfy many of our custom widgets, allowing them to be changed on-the-fly from the Now Playing page 3. ... :)
author Paper <mrpapersonic@gmail.com>
date Tue, 24 Oct 2023 22:01:02 -0400
parents 3364fadc8a36
children 8043152ef9d4
comparison
equal deleted inserted replaced
82:8b65c417c225 83:d02fdf1d6708
1 #ifndef __gui__widgets__poster_h 1 #ifndef __gui__widgets__poster_h
2 #define __gui__widgets__poster_h 2 #define __gui__widgets__poster_h
3 #include <QByteArray>
4 #include <QFrame> 3 #include <QFrame>
5 #include <QImage> 4 #include <QImage>
6 5
7 class QWidget; 6 class QWidget;
8 class ClickableLabel; 7 class ClickableLabel;
8 namespace Anime {
9 class Anime;
10 }
9 11
10 class Poster : public QFrame { 12 class Poster : public QFrame {
11 Q_OBJECT 13 Q_OBJECT
12 14
13 public: 15 public:
14 Poster(int id, QWidget* parent = nullptr); 16 Poster(QWidget* parent = nullptr);
17 Poster(const Anime::Anime& anime, QWidget* parent = nullptr);
18 void SetAnime(const Anime::Anime& anime);
15 19
16 protected: 20 protected:
17 void resizeEvent(QResizeEvent*) override; 21 void resizeEvent(QResizeEvent*) override;
18 void ImageDownloadFinished(QByteArray arr); 22 void ImageDownloadFinished(const QByteArray& arr);
19 void RenderToLabel(); 23 void RenderToLabel();
20 24
21 private: 25 private:
22 QImage img; 26 QImage img;
23 ClickableLabel* label; 27 ClickableLabel* label;