Mercurial > minori
annotate src/gui/pages/seasons.cc @ 258:862d0d8619f6
*: HUUUGE changes
animia has been renamed to animone, so instead of thinking of a
health condition, you think of a beautiful flower :)
I've also edited some of the code for animone, but I have no idea
if it even works or not because I don't have a mac or windows
machine lying around. whoops!
... anyway, all of the changes divergent from Anisthesia are now
licensed under BSD. it's possible that I could even rewrite most
of the code to where I don't even have to keep the MIT license,
but that's thinking too far into the future
I've been slacking off on implementing the anime seasons page,
mostly out of laziness. I think I'd have to create another db file
specifically for the seasons
anyway, this code is being pushed *primarily* because the hard drive
it's on is failing! yay :)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 01 Apr 2024 02:43:44 -0400 |
parents | fe702c8f161f |
children | dd211ff68b36 |
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 | 3 #include "core/anime_db.h" |
4 #include "gui/widgets/anime_button.h" | |
5 | |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
6 #include <QFrame> |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
7 #include <QListWidget> |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
8 #include <QListWidgetItem> |
255 | 9 #include <QMenu> |
258 | 10 #include <QToolBar> |
255 | 11 #include <QToolButton> |
258 | 12 #include <QVBoxLayout> |
253 | 13 |
64 | 14 SeasonsPage::SeasonsPage(QWidget* parent) : QWidget(parent) { |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
15 QVBoxLayout* full_layout = new QVBoxLayout(this); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
16 |
253 | 17 { |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
18 /* Toolbar */ |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
19 QToolBar* toolbar = new QToolBar(this); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
20 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
21 toolbar->setIconSize(QSize(16, 16)); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
22 toolbar->setMovable(false); |
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 { |
255 | 25 { |
26 QAction* action = new QAction(toolbar); | |
27 action->setIcon(QIcon(":/icons/16x16/calendar-previous.png")); | |
28 action->setToolTip(tr("Previous season")); | |
29 toolbar->addAction(action); | |
30 } | |
31 | |
32 { | |
33 QAction* action = new QAction(toolbar); | |
34 action->setIcon(QIcon(":/icons/16x16/calendar-next.png")); | |
35 action->setToolTip(tr("Next season")); | |
36 toolbar->addAction(action); | |
37 } | |
38 | |
258 | 39 toolbar->addAction(QIcon(":/icons/16x16/calendar.png"), |
40 "Fall 2024"); // this must be named the name of the season | |
255 | 41 } |
42 | |
43 toolbar->addSeparator(); | |
44 | |
258 | 45 { toolbar->addAction(QIcon(":/icons/16x16/arrow-circle-315.png"), tr("Refresh data")); } |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
46 |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
47 toolbar->addSeparator(); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
48 |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
49 { |
255 | 50 QToolButton* button = new QToolButton(toolbar); |
51 | |
52 { | |
53 /* links */ | |
54 QMenu* menu = new QMenu(button); | |
55 menu->addAction("Airing status"); | |
56 menu->addAction("List status"); | |
57 menu->addAction("Type"); | |
58 button->setMenu(menu); | |
59 } | |
60 | |
61 button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | |
62 button->setIcon(QIcon(":/icons/16x16/category.png")); | |
63 button->setText("Group by:"); | |
64 button->setPopupMode(QToolButton::InstantPopup); | |
65 toolbar->addWidget(button); | |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
66 } |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
67 |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
68 { |
255 | 69 QToolButton* button = new QToolButton(toolbar); |
70 | |
71 { | |
72 /* links */ | |
73 QMenu* menu = new QMenu(button); | |
74 menu->addAction("Airing date"); | |
75 menu->addAction("Episodes"); | |
76 menu->addAction("Popularity"); | |
77 menu->addAction("Score"); | |
78 menu->addAction("Title"); | |
79 button->setMenu(menu); | |
80 } | |
81 | |
82 button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | |
83 button->setIcon(QIcon(":/icons/16x16/sort-quantity-descending.png")); | |
84 button->setText("Sort by:"); | |
85 button->setPopupMode(QToolButton::InstantPopup); | |
86 toolbar->addWidget(button); | |
254
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 |
255 | 89 { |
90 QToolButton* button = new QToolButton(toolbar); | |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
91 |
255 | 92 { |
93 /* links */ | |
94 QMenu* menu = new QMenu(button); | |
95 menu->addAction("Images"); | |
96 menu->addAction("Details"); | |
97 button->setMenu(menu); | |
98 } | |
99 | |
100 button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | |
101 button->setIcon(QIcon(":/icons/16x16/ui-scroll-pane-detail.png")); | |
102 button->setText("View:"); | |
103 button->setPopupMode(QToolButton::InstantPopup); | |
104 toolbar->addWidget(button); | |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
105 } |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
106 |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
107 full_layout->addWidget(toolbar); |
253 | 108 } |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
109 |
253 | 110 { |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
111 QFrame* line = new QFrame(this); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
112 line->setFrameShape(QFrame::HLine); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
113 line->setFrameShadow(QFrame::Sunken); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
114 line->setLineWidth(1); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
115 full_layout->addWidget(line); |
253 | 116 } |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
117 |
253 | 118 { |
254
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
119 buttons = new QListWidget(this); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
120 buttons->setFlow(QListView::LeftToRight); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
121 buttons->setWrapping(true); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
122 buttons->setContentsMargins(4, 4, 4, 4); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
123 buttons->setSpacing(2); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
124 buttons->setResizeMode(QListView::Adjust); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
125 |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
126 { |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
127 QListWidgetItem* item = new QListWidgetItem; |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
128 AnimeButton* button = new AnimeButton(this); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
129 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
130 item->setSizeHint(button->sizeHint()); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
131 buttons->addItem(item); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
132 buttons->setItemWidget(item, button); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
133 } |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
134 { |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
135 QListWidgetItem* item = new QListWidgetItem; |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
136 AnimeButton* button = new AnimeButton(this); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
137 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
138 item->setSizeHint(button->sizeHint()); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
139 buttons->addItem(item); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
140 buttons->setItemWidget(item, button); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
141 } |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
142 { |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
143 QListWidgetItem* item = new QListWidgetItem; |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
144 AnimeButton* button = new AnimeButton(this); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
145 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
146 item->setSizeHint(button->sizeHint()); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
147 buttons->addItem(item); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
148 buttons->setItemWidget(item, button); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
149 } |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
150 { |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
151 QListWidgetItem* item = new QListWidgetItem; |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
152 AnimeButton* button = new AnimeButton(this); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
153 button->SetAnime(Anime::db.items[Anime::db.GetAnimeFromTitle("Another")]); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
154 item->setSizeHint(button->sizeHint()); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
155 buttons->addItem(item); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
156 buttons->setItemWidget(item, button); |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
157 } |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
158 |
d14f8e0e40c3
[UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents:
253
diff
changeset
|
159 full_layout->addWidget(buttons); |
253 | 160 } |
54
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
161 } |