diff src/gui/widgets/anime_info.cpp @ 75:d3e9310598b1

*: refactor some stuff text: "TextParagraph"s are now called sections, because that's the actual word for it :P text: new classes: Line and OneLineSection, solves many problems with paragraphs that are only one line long (ex. going out of bounds) http: reworked http stuff to allow threaded get requests, also moved it to its own file to (hopefully) remove clutter eventually I'll make a threaded post request method and use that in the "basic" function
author Paper <mrpapersonic@gmail.com>
date Wed, 04 Oct 2023 01:42:30 -0400
parents fe719c109dbc
children 825506f0e221
line wrap: on
line diff
--- a/src/gui/widgets/anime_info.cpp	Tue Oct 03 06:12:43 2023 -0400
+++ b/src/gui/widgets/anime_info.cpp	Wed Oct 04 01:42:30 2023 -0400
@@ -10,9 +10,8 @@
 	QVBoxLayout* layout = new QVBoxLayout(this);
 
 	/* alt titles */
-	TextWidgets::SelectableTextParagraph* title = new TextWidgets::SelectableTextParagraph(
-	    tr("Alternative titles"), QString::fromUtf8(Strings::Implode(anime.GetTitleSynonyms(), ", ").c_str()), this);
-	title->GetParagraph()->setWordWrapMode(QTextOption::NoWrap);
+	TextWidgets::OneLineSection* title = new TextWidgets::OneLineSection(
+	    tr("Alternative titles"), Strings::ToQString(Strings::Implode(anime.GetTitleSynonyms(), ", ").c_str()), this);
 	layout->addWidget(title);
 
 	/* details */
@@ -24,12 +23,12 @@
 	               << Translate::ToString(anime.GetSeason()).c_str() << " " << anime.GetAirDate().GetYear() << "\n"
 	               << Strings::Implode(anime.GetGenres(), ", ").c_str() << "\n"
 	               << anime.GetAudienceScore() << "%";
-	layout->addWidget(new TextWidgets::LabelledTextParagraph(
+	layout->addWidget(new TextWidgets::LabelledSection(
 	    tr("Details"), tr("Type:\nEpisodes:\nStatus:\nSeason:\nGenres:\nScore:"), details_data, this));
 
 	/* synopsis */
-	TextWidgets::SelectableTextParagraph* synopsis =
-	    new TextWidgets::SelectableTextParagraph(tr("Synopsis"), QString::fromUtf8(anime.GetSynopsis().c_str()), this);
+	TextWidgets::SelectableSection* synopsis =
+	    new TextWidgets::SelectableSection(tr("Synopsis"), QString::fromUtf8(anime.GetSynopsis().c_str()), this);
 
 	synopsis->GetParagraph()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
 	layout->addWidget(synopsis);