QTfrontend/gameuiconfig.cpp
changeset 8298 f9e6da8f94b1
parent 8297 b236e3afed0d
parent 8292 c284ea71a4f8
child 8299 ef2e284255cd
equal deleted inserted replaced
8297:b236e3afed0d 8298:f9e6da8f94b1
   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", 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));