QTfrontend/gameuiconfig.cpp
changeset 8292 c284ea71a4f8
parent 8290 3240f4500ac1
child 8298 f9e6da8f94b1
equal deleted inserted replaced
8290:3240f4500ac1 8292:c284ea71a4f8
   190 void GameUIConfig::resizeToConfigValues()
   190 void GameUIConfig::resizeToConfigValues()
   191 {
   191 {
   192     // fill 2/3 of the screen desktop
   192     // fill 2/3 of the screen desktop
   193     const QRect deskSize = QApplication::desktop()->screenGeometry(-1);
   193     const QRect deskSize = QApplication::desktop()->screenGeometry(-1);
   194     Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(),
   194     Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(),
   195                  value("frontend/height", qMax(qMin(deskSize.height()*2/3,600),deskSize.height())).toUInt());
   195                  value("frontend/height", qMin(qMax(deskSize.height()*2/3,600),deskSize.height())).toUInt());
   196 
   196 
   197     // move the window to the center of the screen
   197     // move the window to the center of the screen
   198     QPoint center = QApplication::desktop()->availableGeometry(-1).center();
   198     QPoint center = QApplication::desktop()->availableGeometry(-1).center();
   199     center.setX(center.x() - (Form->width()/2));
   199     center.setX(center.x() - (Form->width()/2));
   200     center.setY(center.y() - (Form->height()/2));
   200     center.setY(center.y() - (Form->height()/2));