[PC-BSD Commits] r5554 - pcbsd/trunk/SysInstaller

svn at pcbsd.org svn at pcbsd.org
Fri Dec 11 08:22:51 PST 2009


Author: kris
Date: 2009-12-11 08:22:51 -0800 (Fri, 11 Dec 2009)
New Revision: 5554

Modified:
   pcbsd/trunk/SysInstaller/main.cpp
Log:

Center the SysInstaller in the middle of the screen



Modified: pcbsd/trunk/SysInstaller/main.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/main.cpp	2009-12-11 15:57:31 UTC (rev 5553)
+++ pcbsd/trunk/SysInstaller/main.cpp	2009-12-11 16:22:51 UTC (rev 5554)
@@ -1,6 +1,7 @@
 #include <QtGui/QApplication>
 #include <QTranslator>
 #include <QLocale>
+#include <QDesktopWidget>
 #include <QFile>
 
 #include "sysinstaller.h"
@@ -46,6 +47,14 @@
       if ( ! langCode.isEmpty() )
         w.changeLang(langCode);
 
+      // Center the installer
+      QDesktopWidget *desk = a.desktop();
+      QRect dimensions = desk->screenGeometry();
+      int wid = dimensions.width();     // returns desktop width
+      int hig = dimensions.height();    // returns desktop height
+      w.setGeometry((wid/2) - (800/2), (hig/2) - (600/2), 800, 600);
+  
+
       w.show();
       
 



More information about the Commits mailing list