diff src/gui/dialog/settings.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 5ccb99bfa605
line wrap: on
line diff
--- a/src/gui/dialog/settings.cpp	Mon Oct 02 21:33:25 2023 -0400
+++ b/src/gui/dialog/settings.cpp	Tue Oct 03 03:38:25 2023 -0400
@@ -6,6 +6,7 @@
 #include <QVBoxLayout>
 #include <QHBoxLayout>
 #include <QWidget>
+#include <QLabel>
 
 SettingsPage::SettingsPage(QWidget* parent, QString title) : QWidget(parent) {
 	setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
@@ -51,7 +52,6 @@
 }
 
 void SettingsDialog::OnOK() {
-	QStackedWidget* stacked = reinterpret_cast<QStackedWidget*>(layout()->itemAt(1)->widget());
 	for (int i = 0; i < stacked->count(); i++) {
 		reinterpret_cast<SettingsPage*>(stacked->widget(i))->SaveInfo();
 	}
@@ -80,13 +80,12 @@
 	sidebar->setFont(font);
 
 	QPalette pal(sidebar->palette());
-	pal.setColor(QPalette::Base, pal.color(QPalette::Window));
-	sidebar->setPalette(pal);
+	sidebar->SetBackgroundColor(pal.color(QPalette::Base));
 
 	sidebar->setFixedWidth(158);
 	sidebar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
 
-	QStackedWidget* stacked = new QStackedWidget(this);
+	stacked = new QStackedWidget(this);
 	stacked->addWidget(new SettingsPageServices(stacked));
 	stacked->addWidget(new SettingsPageApplication(stacked));
 	stacked->setCurrentIndex(0);