Mercurial > minori
annotate include/gui/widgets/poster.h @ 198:bc1ae1810855
dep/animia: switch from using classes to global functions
the old idea was ok, but sort of hackish; this method doesn't use classes
at all, and this way (especially important!) we can do wayland stuff AND x11
at the same time, which wasn't really possible without stupid workarounds in
the other method
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 24 Dec 2023 02:59:42 -0500 |
parents | 8043152ef9d4 |
children | d14f8e0e40c3 |
rev | line source |
---|---|
66 | 1 #ifndef __gui__widgets__poster_h |
2 #define __gui__widgets__poster_h | |
3 #include <QFrame> | |
4 #include <QImage> | |
5 | |
6 class QWidget; | |
67
442065432549
poster: make posters link to AniList
Paper <mrpapersonic@gmail.com>
parents:
66
diff
changeset
|
7 class ClickableLabel; |
83 | 8 namespace Anime { |
9 class Anime; | |
10 } | |
66 | 11 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
83
diff
changeset
|
12 class Poster final : public QFrame { |
66 | 13 Q_OBJECT |
14 | |
15 public: | |
83 | 16 Poster(QWidget* parent = nullptr); |
17 Poster(const Anime::Anime& anime, QWidget* parent = nullptr); | |
18 void SetAnime(const Anime::Anime& anime); | |
66 | 19 |
20 protected: | |
67
442065432549
poster: make posters link to AniList
Paper <mrpapersonic@gmail.com>
parents:
66
diff
changeset
|
21 void resizeEvent(QResizeEvent*) override; |
83 | 22 void ImageDownloadFinished(const QByteArray& arr); |
75 | 23 void RenderToLabel(); |
66 | 24 |
25 private: | |
26 QImage img; | |
67
442065432549
poster: make posters link to AniList
Paper <mrpapersonic@gmail.com>
parents:
66
diff
changeset
|
27 ClickableLabel* label; |
66 | 28 }; |
29 | |
30 #endif // __gui__widgets__poster_h |