diff src/dialog/information.cpp @ 6:1d82f6e04d7d

Update: add first parts to the settings dialog
author Paper <mrpapersonic@gmail.com>
date Wed, 16 Aug 2023 00:49:17 -0400
parents 190ded9438c0
children 07a9095eaeed
line wrap: on
line diff
--- a/src/dialog/information.cpp	Sat Aug 12 13:10:34 2023 -0400
+++ b/src/dialog/information.cpp	Wed Aug 16 00:49:17 2023 -0400
@@ -25,15 +25,17 @@
 	widget->move(175, 0);
 	widget->setStyleSheet(UiUtils::IsInDarkMode() ? "" : "background-color: white");
 	widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
-	QPlainTextEdit* anime_title = new QPlainTextEdit(QString::fromWCharArray(anime->title.english.c_str()), widget);
+	QPlainTextEdit* anime_title = new QPlainTextEdit(QString::fromUtf8(anime->title.english.c_str()), widget);
 	anime_title->setReadOnly(true);
 	anime_title->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 	anime_title->setWordWrapMode(QTextOption::NoWrap);
 	anime_title->setFrameShape(QFrame::NoFrame);
+	anime_title->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+	anime_title->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+	anime_title->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+	anime_title->setStyleSheet("font-size: 16px; color: blue; background: transparent;");
 	anime_title->resize(636, 28);
 	anime_title->move(0, 12);
-	anime_title->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
-	anime_title->setStyleSheet("font-size: 16px; color: blue");
 	QTabWidget* tabbed_widget = new QTabWidget(widget);
 	tabbed_widget->resize(636, 485);
 	tabbed_widget->move(0, 45);
@@ -49,15 +51,15 @@
 	               << StringUtils::Implode(anime->genres, ", ").c_str() << "\n"
 	               << anime->audience_score << "%\n";
 	UiUtils::CreateTextParagraphWithLabels(main_information_widget, "Details", "Type:\nEpisodes:\nStatus:\nSeason:\nGenres:\nScore:", details_data, QPoint(6, 62), QSize(636-18, 142));
-	UiUtils::CreateSelectableTextParagraph(main_information_widget, "Synopsis", QString::fromWCharArray(anime->synopsis.c_str()), QPoint(6, 202), QSize(636-18, 253));
+	UiUtils::CreateSelectableTextParagraph(main_information_widget, "Synopsis", QString::fromUtf8(anime->synopsis.c_str()), QPoint(6, 202), QSize(636-18, 253));
 	tabbed_widget->addTab(main_information_widget, "Main information");
 	QWidget* settings_widget = new QWidget(tabbed_widget);
 	tabbed_widget->addTab(settings_widget, "My list and settings");
 	QDialogButtonBox* button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
 	connect(button_box, &QDialogButtonBox::accepted, this, &InformationDialog::OnOK);
 	connect(button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
-	QVBoxLayout* buttons_layout = new QVBoxLayout(widget);
-	buttons_layout->addWidget(widget, 0, Qt::AlignTop);
+	QVBoxLayout* buttons_layout = new QVBoxLayout(this);
+	//buttons_layout->addWidget(widget, 0, Qt::AlignTop);
 	buttons_layout->addWidget(button_box, 0, Qt::AlignBottom);
 	// this should probably be win32-only
 	setStyleSheet(UiUtils::IsInDarkMode() ? "" : "QDialog#infodiag{background-color: white;}");