Mercurial > minori
comparison 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 | abd956418fe9 |
comparison
equal
deleted
inserted
replaced
| 347:a0aa8c8c4307 | 348:6b0768158dcd |
|---|---|
| 1 #ifndef MINORI_GUI_PAGES_NOW_PLAYING_H_ | 1 #ifndef MINORI_GUI_PAGES_NOW_PLAYING_H_ |
| 2 #define MINORI_GUI_PAGES_NOW_PLAYING_H_ | 2 #define MINORI_GUI_PAGES_NOW_PLAYING_H_ |
| 3 | 3 |
| 4 #include "gui/widgets/anime_info.h" | 4 #include "gui/widgets/anime_info.h" |
| 5 #include "gui/widgets/poster.h" | 5 #include "gui/widgets/poster.h" |
| 6 #include "gui/widgets/sidebar.h" | |
| 6 #include "gui/widgets/text.h" | 7 #include "gui/widgets/text.h" |
| 7 | 8 |
| 8 #include <QFrame> | 9 #include <QFrame> |
| 10 #include <QStackedWidget> | |
| 11 | |
| 9 #include <memory> | 12 #include <memory> |
| 10 #include <unordered_map> | 13 #include <unordered_map> |
| 11 | 14 |
| 12 class QStackedWidget; | |
| 13 | 15 |
| 14 namespace Anime { | 16 namespace Anime { |
| 15 class Anime; | 17 class Anime; |
| 16 } | 18 } |
| 17 | 19 |
| 18 namespace anitomy { | 20 namespace anitomy { |
| 19 class Elements; | 21 class Elements; |
| 20 } | 22 } |
| 21 | 23 |
| 24 /* -------------------------------------------------------------- */ | |
| 25 /* separate pages */ | |
| 26 | |
| 22 namespace NowPlayingPages { | 27 namespace NowPlayingPages { |
| 23 | 28 |
| 24 class Default : public QWidget { | 29 class Default : public QWidget { |
| 25 Q_OBJECT | 30 Q_OBJECT |
| 26 | 31 |
| 27 public: | 32 public: |
| 28 Default(QWidget* parent = nullptr); | 33 Default(QWidget* parent = nullptr); |
| 34 | |
| 35 private: | |
| 36 TextWidgets::Title title_; | |
| 29 }; | 37 }; |
| 30 | 38 |
| 31 class Playing : public QWidget { | 39 class Playing : public QWidget { |
| 32 Q_OBJECT | 40 Q_OBJECT |
| 33 | 41 |
| 37 int GetPlayingAnime(); | 45 int GetPlayingAnime(); |
| 38 | 46 |
| 39 private: | 47 private: |
| 40 int _id = 0; | 48 int _id = 0; |
| 41 int _episode = 0; | 49 int _episode = 0; |
| 42 std::unique_ptr<QWidget> _main = nullptr; | 50 |
| 43 std::unique_ptr<TextWidgets::Title> _title = nullptr; | 51 QWidget _main; |
| 44 std::unique_ptr<AnimeInfoWidget> _info = nullptr; | 52 TextWidgets::Title _title; |
| 45 std::unique_ptr<QWidget> _sidebar = nullptr; | 53 AnimeInfoWidget _info; |
| 46 std::unique_ptr<Poster> _poster = nullptr; | 54 |
| 55 QWidget _sidebar; | |
| 56 Poster _poster; | |
| 47 }; | 57 }; |
| 48 | 58 |
| 49 } // namespace NowPlayingPages | 59 } // namespace NowPlayingPages |
| 60 | |
| 61 /* -------------------------------------------------------------- */ | |
| 62 /* the full page */ | |
| 50 | 63 |
| 51 class NowPlayingPage final : public QFrame { | 64 class NowPlayingPage final : public QFrame { |
| 52 Q_OBJECT | 65 Q_OBJECT |
| 53 | 66 |
| 54 public: | 67 public: |
| 56 void SetDefault(); | 69 void SetDefault(); |
| 57 void SetPlaying(const Anime::Anime& anime, const anitomy::Elements& episodes); | 70 void SetPlaying(const Anime::Anime& anime, const anitomy::Elements& episodes); |
| 58 int GetPlayingId(); | 71 int GetPlayingId(); |
| 59 | 72 |
| 60 private: | 73 private: |
| 61 QStackedWidget* stack; | 74 enum class Subpages { |
| 75 Default = 0, | |
| 76 Playing = 1, | |
| 77 }; | |
| 78 | |
| 79 QStackedWidget stack_; | |
| 80 | |
| 81 NowPlayingPages::Default default_; | |
| 82 NowPlayingPages::Playing playing_; | |
| 62 }; | 83 }; |
| 63 | 84 |
| 64 #endif // MINORI_GUI_PAGES_NOW_PLAYING_H_ | 85 #endif // MINORI_GUI_PAGES_NOW_PLAYING_H_ |
