QTfrontend/gameuiconfig.cpp
changeset 674 a15c8e3c69b3
parent 657 b34fc518a48a
child 883 07a568ba44e0
--- a/QTfrontend/gameuiconfig.cpp	Sun Dec 16 15:58:29 2007 +0000
+++ b/QTfrontend/gameuiconfig.cpp	Sun Dec 16 16:21:42 2007 +0000
@@ -20,6 +20,7 @@
 #include <QCheckBox>
 #include <QLineEdit>
 #include <QDesktopWidget>
+#include <QApplication>
 
 #include "gameuiconfig.h"
 #include "hwform.h"
@@ -32,6 +33,8 @@
 {
 	Form = FormWidgets;
 
+	Form->resize(value("window/width", 640).toUInt(), value("window/height", 450).toUInt());
+
 	int t = Form->ui.pageOptions->CBResolution->findText(value("video/resolution").toString());
 	Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 0 : t);
 	Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool());
@@ -52,8 +55,7 @@
 
 	Form->ui.pageOptions->CBAltDamage->setChecked(value("misc/altdamage", false).toBool());
 
-	QDesktopWidget desktop;
-	depth = desktop.depth();
+	depth = QApplication::desktop()->depth();
 	if (depth < 16) depth = 16;
 	else if (depth > 16) depth = 32;
 }
@@ -86,6 +88,9 @@
 	setValue("fps/interval", Form->ui.pageOptions->fpsedit->value());
 
 	setValue("misc/altdamage", isAltDamageEnabled());
+
+	setValue("window/width", Form->width());
+	setValue("window/height", Form->height());
 }
 
 QRect GameUIConfig::vid_Resolution()