[PC-BSD Commits] r712 - pcbsd/trunk/XGUISource

svn at pcbsd.org svn at pcbsd.org
Wed Sep 12 20:11:02 PDT 2007


Author: kris
Date: 2007-09-12 20:11:02 -0700 (Wed, 12 Sep 2007)
New Revision: 712

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

Added same centering fix to the XGUI source



Modified: pcbsd/trunk/XGUISource/main.cpp
===================================================================
--- pcbsd/trunk/XGUISource/main.cpp	2007-09-13 03:08:47 UTC (rev 711)
+++ pcbsd/trunk/XGUISource/main.cpp	2007-09-13 03:11:02 UTC (rev 712)
@@ -55,7 +55,13 @@
 
     XGUI w;
     w.ProgramInit();
-    w.setGeometry(200, 200, 400, 200);
+
+    QDesktopWidget *desk = QApplication::desktop();
+    int wid = desk->width();     // returns desktop width
+    int hig = desk->height();    // returns desktop height
+
+    w.setGeometry((wid/2) - (400/2), (hig/2) - (200/2), 400, 200);
+
     w.setStyle(QStyleFactory::create( "Plastik" ));
     w.show();
     a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );



More information about the Commits mailing list