QTfrontend/gameuiconfig.cpp
changeset 8184 e0c8fad98022
parent 8179 a1ffcb559f99
child 8185 1c3739ba4352
--- a/QTfrontend/gameuiconfig.cpp	Sat Dec 01 19:57:57 2012 -0500
+++ b/QTfrontend/gameuiconfig.cpp	Sun Dec 02 14:51:54 2012 +0100
@@ -179,7 +179,16 @@
 
 void GameUIConfig::resizeToConfigValues()
 {
-    Form->resize(value("frontend/width", 800).toUInt(), value("frontend/height", 600).toUInt());
+    // fill 2/3 of the screen desktop
+    const QRect deskSize = QApplication::desktop()->screenGeometry(-1);
+    Form->resize(value("frontend/width", deskSize.width()*2/3).toUInt(),
+                 value("frontend/height", deskSize.height()*2/3).toUInt());
+
+    // move the window to the center of the screen
+    QPoint center = QApplication::desktop()->availableGeometry(-1).center();
+    center.setX(center.x() - (Form->width()/2));
+    center.setY(center.y() - (Form->height()/2));
+    Form->move(center);
 }
 
 void GameUIConfig::SaveOptions()