Mercurial > minori
view include/gui/pages/now_playing.h @ 348:6b0768158dcd
text: redesign almost every widget
i.e. Paragraph is now a QLabel, etc etc, some things will probably
break, idc
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 25 Jun 2024 11:19:54 -0400 |
parents | 3ec7804abf17 |
children |
line wrap: on
line source
#ifndef MINORI_GUI_PAGES_NOW_PLAYING_H_ #define MINORI_GUI_PAGES_NOW_PLAYING_H_ #include "gui/widgets/anime_info.h" #include "gui/widgets/poster.h" #include "gui/widgets/sidebar.h" #include "gui/widgets/text.h" #include <QFrame> #include <QStackedWidget> #include <memory> #include <unordered_map> namespace Anime { class Anime; } namespace anitomy { class Elements; } /* -------------------------------------------------------------- */ /* separate pages */ namespace NowPlayingPages { class Default : public QWidget { Q_OBJECT public: Default(QWidget* parent = nullptr); private: TextWidgets::Title title_; }; class Playing : public QWidget { Q_OBJECT public: Playing(QWidget* parent = nullptr); void SetPlayingAnime(const Anime::Anime& anime, const anitomy::Elements& info); int GetPlayingAnime(); private: int _id = 0; int _episode = 0; QWidget _main; TextWidgets::Title _title; AnimeInfoWidget _info; QWidget _sidebar; Poster _poster; }; } // namespace NowPlayingPages /* -------------------------------------------------------------- */ /* the full page */ class NowPlayingPage final : public QFrame { Q_OBJECT public: NowPlayingPage(QWidget* parent = nullptr); void SetDefault(); void SetPlaying(const Anime::Anime& anime, const anitomy::Elements& episodes); int GetPlayingId(); private: enum class Subpages { Default = 0, Playing = 1, }; QStackedWidget stack_; NowPlayingPages::Default default_; NowPlayingPages::Playing playing_; }; #endif // MINORI_GUI_PAGES_NOW_PLAYING_H_