comparison src/gui/dialog/information.cpp @ 69:27a19dd6cba1

*: fix up some stuff settings: due to my own incompetence OnOK caused the entire program to crash, now that's fixed :)
author Paper <mrpapersonic@gmail.com>
date Tue, 03 Oct 2023 03:38:25 -0400
parents 2417121d894e
children 3364fadc8a36
comparison
equal deleted inserted replaced
68:2417121d894e 69:27a19dd6cba1
16 #include <QDebug> 16 #include <QDebug>
17 #include <QDialogButtonBox> 17 #include <QDialogButtonBox>
18 #include <QLineEdit> 18 #include <QLineEdit>
19 #include <QPlainTextEdit> 19 #include <QPlainTextEdit>
20 #include <QSpinBox> 20 #include <QSpinBox>
21 #include <QLabel>
21 #include <QStringList> 22 #include <QStringList>
22 #include <QTextStream> 23 #include <QTextStream>
23 #include <QVBoxLayout> 24 #include <QVBoxLayout>
24 #include <functional> 25 #include <functional>
25 26
41 setFixedSize(842, 613); 42 setFixedSize(842, 613);
42 setWindowTitle(tr("Anime Information")); 43 setWindowTitle(tr("Anime Information"));
43 setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); 44 setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
44 45
45 { 46 {
46 QPalette pal; 47 QPalette pal(palette());
47 pal.setColor(QPalette::Window, Qt::white); 48 pal.setColor(QPalette::Window, pal.color(QPalette::Base));
48 setPalette(pal); 49 setPalette(pal);
49 } 50 }
50 51
51 QWidget* widget = new QWidget(this); 52 QWidget* widget = new QWidget(this);
52 53
59 sidebar_layout->addStretch(); 60 sidebar_layout->addStretch();
60 61
61 /* main widget */ 62 /* main widget */
62 QWidget* main_widget = new QWidget(widget); 63 QWidget* main_widget = new QWidget(widget);
63 64
64 {
65 QPalette pal;
66 pal.setColor(QPalette::Window, Qt::white);
67 main_widget->setPalette(pal);
68 }
69
70 main_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); 65 main_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
71 66
72 id = anime.GetId(); 67 id = anime.GetId();
73 /* anime title header text */ 68 /* anime title header text */
74 TextWidgets::Title* anime_title = 69 TextWidgets::Title* anime_title =
78 QTabWidget* tabbed_widget = new QTabWidget(main_widget); 73 QTabWidget* tabbed_widget = new QTabWidget(main_widget);
79 tabbed_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); 74 tabbed_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
80 75
81 /* main info tab */ 76 /* main info tab */
82 AnimeInfoWidget* main_information_widget = new AnimeInfoWidget(anime, tabbed_widget); 77 AnimeInfoWidget* main_information_widget = new AnimeInfoWidget(anime, tabbed_widget);
78
79 {
80 QPalette pal(main_information_widget->palette());
81 pal.setColor(QPalette::Base, pal.color(QPalette::Window));
82 main_information_widget->setPalette(pal);
83 }
83 84
84 QWidget* settings_widget = new QWidget(tabbed_widget); 85 QWidget* settings_widget = new QWidget(tabbed_widget);
85 settings_widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); 86 settings_widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
86 87
87 QVBoxLayout* settings_layout = new QVBoxLayout(settings_widget); 88 QVBoxLayout* settings_layout = new QVBoxLayout(settings_widget);
103 subsection->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); \ 104 subsection->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); \
104 QVBoxLayout* subsection_layout = new QVBoxLayout(subsection); \ 105 QVBoxLayout* subsection_layout = new QVBoxLayout(subsection); \
105 subsection_layout->setSpacing(LAYOUT_VERT_SPACING); \ 106 subsection_layout->setSpacing(LAYOUT_VERT_SPACING); \
106 subsection_layout->setContentsMargins(0, 0, 0, 0); \ 107 subsection_layout->setContentsMargins(0, 0, 0, 0); \
107 x; \ 108 x; \
108 layout->addWidget(subsection); \ 109 layout->addWidget(subsection, 0, Qt::AlignBottom); \
109 } 110 }
110 111
111 /* Creates a section in the parent `a` */ 112 /* Creates a section in the parent `a` */
112 #define CREATE_FULL_WIDTH_SECTION(a, x) \ 113 #define CREATE_FULL_WIDTH_SECTION(a, x) \
113 { \ 114 { \