Mercurial > minori
view include/gui/widgets/poster.h @ 337:a7d4e5107531
dep/animone: REFACTOR ALL THE THINGS
1: animone now has its own syntax divergent from anisthesia,
making different platforms actually have their own sections
2: process names in animone are now called `comm' (this will
probably break things). this is what its called in bsd/linux
so I'm just going to use it everywhere
3: the X11 code now checks for the existence of a UTF-8 window title
and passes it if available
4: ANYTHING THATS NOT LINUX IS 100% UNTESTED AND CAN AND WILL BREAK!
I still actually need to test the bsd code. to be honest I'm probably
going to move all of the bsds into separate files because they're
all essentially different operating systems at this point
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 19 Jun 2024 12:51:15 -0400 |
parents | b1f625b0227c |
children | 6b0768158dcd |
line wrap: on
line source
#ifndef MINORI_GUI_WIDGETS_POSTER_H_ #define MINORI_GUI_WIDGETS_POSTER_H_ #include <QFrame> #include <QImage> #include "gui/widgets/clickable_label.h" #include "core/http.h" namespace Anime { class Anime; } class Poster final : public QFrame { Q_OBJECT 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: /* 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_