Mercurial > minori
annotate include/gui/widgets/poster.h @ 278:c41c14ff8c67
dep/animone: x11: remove debugging comment
oops
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 22 Apr 2024 19:11:31 -0400 |
parents | f31305b9f60a |
children | 9a88e1725fd2 |
rev | line source |
---|---|
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
254
diff
changeset
|
1 #ifndef MINORI_GUI_WIDGETS_POSTER_H_ |
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
254
diff
changeset
|
2 #define MINORI_GUI_WIDGETS_POSTER_H_ |
66 | 3 #include <QFrame> |
4 #include <QImage> | |
5 | |
273
f31305b9f60a
*: various code safety changes
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
6 #include "gui/widgets/clickable_label.h" |
f31305b9f60a
*: various code safety changes
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
7 |
66 | 8 class QWidget; |
83 | 9 namespace Anime { |
10 class Anime; | |
11 } | |
66 | 12 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
83
diff
changeset
|
13 class Poster final : public QFrame { |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
14 Q_OBJECT |
66 | 15 |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
16 public: |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
17 Poster(QWidget* parent = nullptr); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
18 Poster(const Anime::Anime& anime, QWidget* parent = nullptr); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
19 void SetAnime(const Anime::Anime& anime); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
20 void SetClickable(bool clickable); |
66 | 21 |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
22 protected: |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
23 void resizeEvent(QResizeEvent*) override; |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
24 void ImageDownloadFinished(const QByteArray& arr); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
25 void RenderToLabel(); |
66 | 26 |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
95
diff
changeset
|
27 private: |
273
f31305b9f60a
*: various code safety changes
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
28 QImage img_; |
f31305b9f60a
*: various code safety changes
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
29 QString service_url_; |
f31305b9f60a
*: various code safety changes
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
30 ClickableLabel label_; |
f31305b9f60a
*: various code safety changes
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
31 bool clickable_ = true; |
66 | 32 }; |
33 | |
273
f31305b9f60a
*: various code safety changes
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
34 #endif // MINORI_GUI_WIDGETS_POSTER_H_ |