Mercurial > minori
comparison src/gui/widgets/anime_button.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 | f31305b9f60a |
comparison
equal
deleted
inserted
replaced
257:699a20c57dc8 | 258:862d0d8619f6 |
---|---|
1 #include "gui/widgets/anime_button.h" | 1 #include "gui/widgets/anime_button.h" |
2 | 2 |
3 #include "core/anime_db.h" | 3 #include "core/anime_db.h" |
4 #include "core/session.h" | |
4 #include "core/strings.h" | 5 #include "core/strings.h" |
5 #include "core/session.h" | |
6 #include "gui/widgets/text.h" | |
7 #include "gui/widgets/elided_label.h" | 6 #include "gui/widgets/elided_label.h" |
8 #include "gui/widgets/poster.h" | 7 #include "gui/widgets/poster.h" |
8 #include "gui/widgets/text.h" | |
9 | 9 |
10 #include <QDate> | |
11 #include <QHBoxLayout> | |
12 #include <QVBoxLayout> | |
10 #include <QWidget> | 13 #include <QWidget> |
11 #include <QVBoxLayout> | |
12 #include <QHBoxLayout> | |
13 #include <QDate> | |
14 | 14 |
15 /* This widget is only used on the Seasons page. */ | 15 /* This widget is only used on the Seasons page. */ |
16 | 16 |
17 /***********************************\ | 17 /***********************************\ |
18 *|---------| Title * | 18 *|---------| Title * |
52 fnt.setWeight(QFont::Bold); | 52 fnt.setWeight(QFont::Bold); |
53 _title->setFont(fnt); | 53 _title->setFont(fnt); |
54 } | 54 } |
55 misc_layout->addWidget(_title); | 55 misc_layout->addWidget(_title); |
56 | 56 |
57 _info = new TextWidgets::LabelledParagraph(tr("Aired:\nEpisodes:\nGenres:\nProducers:\nScore:\nPopularity:"), "\n\n\n\n\n", misc_section); | 57 _info = new TextWidgets::LabelledParagraph(tr("Aired:\nEpisodes:\nGenres:\nProducers:\nScore:\nPopularity:"), |
58 "\n\n\n\n\n", misc_section); | |
58 { | 59 { |
59 QFont fnt(_info->GetLabels()->font()); | 60 QFont fnt(_info->GetLabels()->font()); |
60 fnt.setWeight(QFont::Bold); | 61 fnt.setWeight(QFont::Bold); |
61 _info->GetLabels()->setFont(fnt); | 62 _info->GetLabels()->setFont(fnt); |
62 } | 63 } |
88 _poster->SetAnime(anime); | 89 _poster->SetAnime(anime); |
89 _title->setText(Strings::ToQString(anime.GetUserPreferredTitle())); | 90 _title->setText(Strings::ToQString(anime.GetUserPreferredTitle())); |
90 | 91 |
91 { | 92 { |
92 const QLocale& locale = session.config.locale.GetLocale(); | 93 const QLocale& locale = session.config.locale.GetLocale(); |
93 _info->GetParagraph()->SetText( | 94 _info->GetParagraph()->SetText(locale.toString(anime.GetAirDate().GetAsQDate(), "dd MMM yyyy") + "\n" + |
94 locale.toString(anime.GetAirDate().GetAsQDate(), "dd MMM yyyy") + "\n" + | 95 QString::number(anime.GetEpisodes()) + "\n" + |
95 QString::number(anime.GetEpisodes()) + "\n" + | 96 Strings::ToQString(Strings::Implode(anime.GetGenres(), ", ")) + "\n" + "...\n" + |
96 Strings::ToQString(Strings::Implode(anime.GetGenres(), ", ")) + "\n" + | 97 QString::number(anime.GetAudienceScore()) + "%\n" + "..."); |
97 "...\n" + | |
98 QString::number(anime.GetAudienceScore()) + "%\n" + | |
99 "..." | |
100 ); | |
101 } | 98 } |
102 | 99 |
103 { | 100 { |
104 QString synopsis = Strings::ToQString(anime.GetSynopsis()); | 101 QString synopsis = Strings::ToQString(anime.GetSynopsis()); |
105 QFontMetrics metrics(_synopsis->font()); | 102 QFontMetrics metrics(_synopsis->font()); |