QTfrontend/gameuiconfig.cpp
changeset 8290 3240f4500ac1
parent 8266 927da572bcdc
child 8292 c284ea71a4f8
equal deleted inserted replaced
8289:302a2521fe7a 8290:3240f4500ac1
   189 
   189 
   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", deskSize.width()*2/3).toUInt(),
   194     Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(),
   195                  value("frontend/height", deskSize.height()*2/3).toUInt());
   195                  value("frontend/height", qMax(qMin(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));