annotate include/gui/widgets/poster.h @ 291:9a88e1725fd2

*: refactor lots of stuff I forgot to put this into different commits, oops! anyway, it doesn't really matter *that* much since this is an unfinished hobby project anyway. once it starts getting stable commit history will be more important, but for now it's not that big of a deal
author Paper <paper@paper.us.eu.org>
date Sun, 12 May 2024 16:31:07 -0400
parents f31305b9f60a
children b82841e76e79
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3 #include <QFrame>
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <QImage>
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5
273
f31305b9f60a *: various code safety changes
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
6 #include "gui/widgets/clickable_label.h"
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 273
diff changeset
7 #include "core/http.h"
273
f31305b9f60a *: various code safety changes
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
8
66
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 class QWidget;
83
d02fdf1d6708 *: huuuge update
Paper <mrpapersonic@gmail.com>
parents: 76
diff changeset
10 namespace Anime {
d02fdf1d6708 *: huuuge update
Paper <mrpapersonic@gmail.com>
parents: 76
diff changeset
11 class Anime;
d02fdf1d6708 *: huuuge update
Paper <mrpapersonic@gmail.com>
parents: 76
diff changeset
12 }
66
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 83
diff changeset
14 class Poster final : public QFrame {
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
15 Q_OBJECT
66
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
17 public:
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
18 Poster(QWidget* parent = nullptr);
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
19 Poster(const Anime::Anime& anime, QWidget* parent = nullptr);
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
20 void SetAnime(const Anime::Anime& anime);
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
21 void SetClickable(bool clickable);
66
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
23 protected:
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
24 void resizeEvent(QResizeEvent*) override;
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
25 void ImageDownloadFinished(const QByteArray& arr);
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
26 void RenderToLabel();
66
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
28 private:
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 273
diff changeset
29 HTTP::RequestThread get_thread_;
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 273
diff changeset
30
273
f31305b9f60a *: various code safety changes
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
31 QImage img_;
f31305b9f60a *: various code safety changes
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
32 QString service_url_;
f31305b9f60a *: various code safety changes
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
33 ClickableLabel label_;
f31305b9f60a *: various code safety changes
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
34 bool clickable_ = true;
66
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
35 };
6481c5aed3e1 posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
36
273
f31305b9f60a *: various code safety changes
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
37 #endif // MINORI_GUI_WIDGETS_POSTER_H_