diff include/gui/widgets/poster.h @ 295:b82841e76e79

*: better support on Windows things now look much better in dark mode
author Paper <paper@paper.us.eu.org>
date Sun, 12 May 2024 20:24:09 -0400
parents 9a88e1725fd2
children b1f625b0227c
line wrap: on
line diff
--- a/include/gui/widgets/poster.h	Sun May 12 18:16:08 2024 -0400
+++ b/include/gui/widgets/poster.h	Sun May 12 20:24:09 2024 -0400
@@ -6,7 +6,6 @@
 #include "gui/widgets/clickable_label.h"
 #include "core/http.h"
 
-class QWidget;
 namespace Anime {
 class Anime;
 }
@@ -17,21 +16,28 @@
 public:
 	Poster(QWidget* parent = nullptr);
 	Poster(const Anime::Anime& anime, QWidget* parent = nullptr);
+	~Poster();
 	void SetAnime(const Anime::Anime& anime);
 	void SetClickable(bool clickable);
 
 protected:
+	void showEvent(QShowEvent*) override;
 	void resizeEvent(QResizeEvent*) override;
 	void ImageDownloadFinished(const QByteArray& arr);
 	void RenderToLabel();
+	void DownloadPoster();
 
 private:
-	HTTP::RequestThread get_thread_;
+	/* stored as a pointer to prevent blocking */
+	HTTP::RequestThread* get_thread_;
 
 	QImage img_;
 	QString service_url_;
+	std::string poster_url_;
 	ClickableLabel label_;
+
 	bool clickable_ = true;
+	bool need_refresh_ = false;
 };
 
 #endif // MINORI_GUI_WIDGETS_POSTER_H_