diff src/gui/pages/seasons.cc @ 254:d14f8e0e40c3

[UNFINISHED] *: update anime button
author Paper <paper@paper.us.eu.org>
date Wed, 07 Feb 2024 07:57:37 -0500
parents b3549da699a6
children fe702c8f161f
line wrap: on
line diff
--- a/src/gui/pages/seasons.cc	Tue Feb 06 16:56:32 2024 -0500
+++ b/src/gui/pages/seasons.cc	Wed Feb 07 07:57:37 2024 -0500
@@ -5,32 +5,95 @@
 #include "gui/layouts/flow_layout.h"
 
 #include <QVBoxLayout>
+#include <QToolBar>
+#include <QFrame>
+#include <QListWidget>
+#include <QListWidgetItem>
 
 SeasonsPage::SeasonsPage(QWidget* parent) : QWidget(parent) {
-	FlowLayout* ly = new FlowLayout(this);
+	QVBoxLayout* full_layout = new QVBoxLayout(this);
+
 	{
-		AnimeButton* button = new AnimeButton(this);
-		button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
-		ly->addWidget(button);
+		/* Toolbar */
+		QToolBar* toolbar = new QToolBar(this);
+		toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+		toolbar->setIconSize(QSize(16, 16));
+		toolbar->setMovable(false);
+
+		{
+			/* this needs to be stored somewhere to replicate Taiga's
+			   "timer" feature */
+			toolbar->addAction("Aids");
+		}
+
+		toolbar->addSeparator();
+
+		{
+			toolbar->addAction(QIcon(":/icons/16x16/navigation-270-button.png"), tr("Download &marked torrents"));
+		}
+
+		{
+			toolbar->addAction(QIcon(":/icons/16x16/cross-button.png"), tr("&Discard all"));
+		}
+
+		toolbar->addSeparator();
+
+		{
+			toolbar->addAction(QIcon(":/icons/16x16/gear.png"), tr("&Settings"));
+		}
+
+		full_layout->addWidget(toolbar);
 	}
-	{
-		AnimeButton* button = new AnimeButton(this);
-		button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
-		ly->addWidget(button);
-	}
+
 	{
-		AnimeButton* button = new AnimeButton(this);
-		button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
-		ly->addWidget(button);
+		QFrame* line = new QFrame(this);
+		line->setFrameShape(QFrame::HLine);
+		line->setFrameShadow(QFrame::Sunken);
+		line->setLineWidth(1);
+		full_layout->addWidget(line);
 	}
+
 	{
-		AnimeButton* button = new AnimeButton(this);
-		button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
-		ly->addWidget(button);
-	}
-	{
-		AnimeButton* button = new AnimeButton(this);
-		button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
-		ly->addWidget(button);
+		buttons = new QListWidget(this);
+		buttons->setFlow(QListView::LeftToRight);
+		buttons->setWrapping(true);
+		buttons->setContentsMargins(4, 4, 4, 4);
+		buttons->setSpacing(2);
+		buttons->setResizeMode(QListView::Adjust);
+
+		{
+			QListWidgetItem* item = new QListWidgetItem;
+			AnimeButton* button = new AnimeButton(this);
+			button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
+			item->setSizeHint(button->sizeHint());
+			buttons->addItem(item);
+			buttons->setItemWidget(item, button);
+		}
+		{
+			QListWidgetItem* item = new QListWidgetItem;
+			AnimeButton* button = new AnimeButton(this);
+			button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
+			item->setSizeHint(button->sizeHint());
+			buttons->addItem(item);
+			buttons->setItemWidget(item, button);
+		}
+		{
+			QListWidgetItem* item = new QListWidgetItem;
+			AnimeButton* button = new AnimeButton(this);
+			button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
+			item->setSizeHint(button->sizeHint());
+			buttons->addItem(item);
+			buttons->setItemWidget(item, button);
+		}
+		{
+			QListWidgetItem* item = new QListWidgetItem;
+			AnimeButton* button = new AnimeButton(this);
+			button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
+			item->setSizeHint(button->sizeHint());
+			buttons->addItem(item);
+			buttons->setItemWidget(item, button);
+		}
+
+		full_layout->addWidget(buttons);
 	}
 }