Mercurial > minori
view include/gui/pages/now_playing.h @ 367:8d45d892be88 default tip
*: instead of pugixml, use Qt XML features
this means we have one extra Qt dependency though...
author | Paper <paper@tflc.us> |
---|---|
date | Sun, 17 Nov 2024 22:55:47 -0500 |
parents | 6b0768158dcd |
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_