diff 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 diff
--- a/include/gui/pages/now_playing.h	Sun Jun 23 10:32:09 2024 -0400
+++ b/include/gui/pages/now_playing.h	Tue Jun 25 11:19:54 2024 -0400
@@ -3,13 +3,15 @@
 
 #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>
 
-class QStackedWidget;
 
 namespace Anime {
 class Anime;
@@ -19,6 +21,9 @@
 class Elements;
 }
 
+/* -------------------------------------------------------------- */
+/* separate pages */
+
 namespace NowPlayingPages {
 
 class Default : public QWidget {
@@ -26,6 +31,9 @@
 
 public:
 	Default(QWidget* parent = nullptr);
+
+private:
+	TextWidgets::Title title_;
 };
 
 class Playing : public QWidget {
@@ -39,15 +47,20 @@
 private:
 	int _id = 0;
 	int _episode = 0;
-	std::unique_ptr<QWidget> _main = nullptr;
-	std::unique_ptr<TextWidgets::Title> _title = nullptr;
-	std::unique_ptr<AnimeInfoWidget> _info = nullptr;
-	std::unique_ptr<QWidget> _sidebar = nullptr;
-	std::unique_ptr<Poster> _poster = nullptr;
+
+	QWidget _main;
+	TextWidgets::Title _title;
+	AnimeInfoWidget _info;
+
+	QWidget _sidebar;
+	Poster _poster;
 };
 
 } // namespace NowPlayingPages
 
+/* -------------------------------------------------------------- */
+/* the full page */
+
 class NowPlayingPage final : public QFrame {
 	Q_OBJECT
 
@@ -58,7 +71,15 @@
 	int GetPlayingId();
 
 private:
-	QStackedWidget* stack;
+	enum class Subpages {
+		Default = 0,
+		Playing = 1,
+	};
+
+	QStackedWidget stack_;
+
+	NowPlayingPages::Default default_;
+	NowPlayingPages::Playing playing_;
 };
 
 #endif // MINORI_GUI_PAGES_NOW_PLAYING_H_