comparison 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
comparison
equal deleted inserted replaced
253:b3549da699a6 254:d14f8e0e40c3
3 #include "core/anime_db.h" 3 #include "core/anime_db.h"
4 #include "gui/widgets/anime_button.h" 4 #include "gui/widgets/anime_button.h"
5 #include "gui/layouts/flow_layout.h" 5 #include "gui/layouts/flow_layout.h"
6 6
7 #include <QVBoxLayout> 7 #include <QVBoxLayout>
8 #include <QToolBar>
9 #include <QFrame>
10 #include <QListWidget>
11 #include <QListWidgetItem>
8 12
9 SeasonsPage::SeasonsPage(QWidget* parent) : QWidget(parent) { 13 SeasonsPage::SeasonsPage(QWidget* parent) : QWidget(parent) {
10 FlowLayout* ly = new FlowLayout(this); 14 QVBoxLayout* full_layout = new QVBoxLayout(this);
15
11 { 16 {
12 AnimeButton* button = new AnimeButton(this); 17 /* Toolbar */
13 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]); 18 QToolBar* toolbar = new QToolBar(this);
14 ly->addWidget(button); 19 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
20 toolbar->setIconSize(QSize(16, 16));
21 toolbar->setMovable(false);
22
23 {
24 /* this needs to be stored somewhere to replicate Taiga's
25 "timer" feature */
26 toolbar->addAction("Aids");
27 }
28
29 toolbar->addSeparator();
30
31 {
32 toolbar->addAction(QIcon(":/icons/16x16/navigation-270-button.png"), tr("Download &marked torrents"));
33 }
34
35 {
36 toolbar->addAction(QIcon(":/icons/16x16/cross-button.png"), tr("&Discard all"));
37 }
38
39 toolbar->addSeparator();
40
41 {
42 toolbar->addAction(QIcon(":/icons/16x16/gear.png"), tr("&Settings"));
43 }
44
45 full_layout->addWidget(toolbar);
15 } 46 }
47
16 { 48 {
17 AnimeButton* button = new AnimeButton(this); 49 QFrame* line = new QFrame(this);
18 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]); 50 line->setFrameShape(QFrame::HLine);
19 ly->addWidget(button); 51 line->setFrameShadow(QFrame::Sunken);
52 line->setLineWidth(1);
53 full_layout->addWidget(line);
20 } 54 }
55
21 { 56 {
22 AnimeButton* button = new AnimeButton(this); 57 buttons = new QListWidget(this);
23 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]); 58 buttons->setFlow(QListView::LeftToRight);
24 ly->addWidget(button); 59 buttons->setWrapping(true);
25 } 60 buttons->setContentsMargins(4, 4, 4, 4);
26 { 61 buttons->setSpacing(2);
27 AnimeButton* button = new AnimeButton(this); 62 buttons->setResizeMode(QListView::Adjust);
28 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]); 63
29 ly->addWidget(button); 64 {
30 } 65 QListWidgetItem* item = new QListWidgetItem;
31 { 66 AnimeButton* button = new AnimeButton(this);
32 AnimeButton* button = new AnimeButton(this); 67 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
33 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]); 68 item->setSizeHint(button->sizeHint());
34 ly->addWidget(button); 69 buttons->addItem(item);
70 buttons->setItemWidget(item, button);
71 }
72 {
73 QListWidgetItem* item = new QListWidgetItem;
74 AnimeButton* button = new AnimeButton(this);
75 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
76 item->setSizeHint(button->sizeHint());
77 buttons->addItem(item);
78 buttons->setItemWidget(item, button);
79 }
80 {
81 QListWidgetItem* item = new QListWidgetItem;
82 AnimeButton* button = new AnimeButton(this);
83 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
84 item->setSizeHint(button->sizeHint());
85 buttons->addItem(item);
86 buttons->setItemWidget(item, button);
87 }
88 {
89 QListWidgetItem* item = new QListWidgetItem;
90 AnimeButton* button = new AnimeButton(this);
91 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]);
92 item->setSizeHint(button->sizeHint());
93 buttons->addItem(item);
94 buttons->setItemWidget(item, button);
95 }
96
97 full_layout->addWidget(buttons);
35 } 98 }
36 } 99 }