comparison src/gui/dialog/information.cpp @ 36:2743011a6042

*: mass update formatted all source files, converted ALL instances of setStyleSheet() to palettes and fonts (stylesheets suck), and I changed the clang-format file because it wasn't working on my laptop for some reason.
author Paper <mrpapersonic@gmail.com>
date Thu, 21 Sep 2023 15:17:47 -0400
parents cde8f67a7c7d
children d0adc4aedfc8
comparison
equal deleted inserted replaced
35:329b7921a6be 36:2743011a6042
15 InformationDialog::InformationDialog(Anime::Anime& anime, std::function<void()> accept, QWidget* parent) 15 InformationDialog::InformationDialog(Anime::Anime& anime, std::function<void()> accept, QWidget* parent)
16 : QDialog(parent) { 16 : QDialog(parent) {
17 setFixedSize(842, 613); 17 setFixedSize(842, 613);
18 setWindowTitle(tr("Anime Information")); 18 setWindowTitle(tr("Anime Information"));
19 setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); 19 setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
20 setObjectName("infodiag"); 20
21 setStyleSheet(UiUtils::IsInDarkMode() ? "" : "QDialog#infodiag{background-color: white;}"); 21 {
22 QPalette pal;
23 pal.setColor(QPalette::Window, Qt::white);
24 setPalette(pal);
25 }
22 26
23 QWidget* widget = new QWidget(this); 27 QWidget* widget = new QWidget(this);
24 28
25 /* "sidebar", includes... just the anime image :) */ 29 /* "sidebar", includes... just the anime image :) */
26 QWidget* sidebar = new QWidget(widget); 30 QWidget* sidebar = new QWidget(widget);
27 sidebar->setFixedWidth(175); 31 sidebar->setFixedWidth(175);
28 32
29 /* main widget */ 33 /* main widget */
30 QWidget* main_widget = new QWidget(widget); 34 QWidget* main_widget = new QWidget(widget);
31 main_widget->setStyleSheet(UiUtils::IsInDarkMode() ? "" : "background-color: white"); 35
36 {
37 QPalette pal;
38 pal.setColor(QPalette::Window, Qt::white);
39 main_widget->setPalette(pal);
40 }
41
32 main_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); 42 main_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
33 43
34 /* anime title header text */ 44 /* anime title header text */
35 UiUtils::Paragraph* anime_title = 45 UiUtils::Paragraph* anime_title =
36 new UiUtils::Paragraph(QString::fromUtf8(anime.GetUserPreferredTitle().c_str()), main_widget); 46 new UiUtils::Paragraph(QString::fromUtf8(anime.GetUserPreferredTitle().c_str()), main_widget);
39 anime_title->setWordWrapMode(QTextOption::NoWrap); 49 anime_title->setWordWrapMode(QTextOption::NoWrap);
40 anime_title->setFrameShape(QFrame::NoFrame); 50 anime_title->setFrameShape(QFrame::NoFrame);
41 anime_title->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); 51 anime_title->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
42 anime_title->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 52 anime_title->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
43 anime_title->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 53 anime_title->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
44 anime_title->setStyleSheet("font-size: 16px; color: blue; background: transparent;"); 54
55 {
56 QFont font(anime_title->font());
57 font.setPointSize(12);
58 anime_title->setFont(font);
59 }
60
61 {
62 QPalette pal;
63 pal.setColor(QPalette::Window, QColor(255, 255, 255, 0));
64 pal.setColor(QPalette::WindowText, Qt::blue);
65 }
45 66
46 /* tabbed widget */ 67 /* tabbed widget */
47 QTabWidget* tabbed_widget = new QTabWidget(main_widget); 68 QTabWidget* tabbed_widget = new QTabWidget(main_widget);
48 tabbed_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); 69 tabbed_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
49 70