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