QTfrontend/gameuiconfig.cpp
changeset 8184 e0c8fad98022
parent 8179 a1ffcb559f99
child 8185 1c3739ba4352
equal deleted inserted replaced
8182:7834c2519070 8184:e0c8fad98022
   177     return cleanedList;
   177     return cleanedList;
   178 }
   178 }
   179 
   179 
   180 void GameUIConfig::resizeToConfigValues()
   180 void GameUIConfig::resizeToConfigValues()
   181 {
   181 {
   182     Form->resize(value("frontend/width", 800).toUInt(), value("frontend/height", 600).toUInt());
   182     // fill 2/3 of the screen desktop
       
   183     const QRect deskSize = QApplication::desktop()->screenGeometry(-1);
       
   184     Form->resize(value("frontend/width", deskSize.width()*2/3).toUInt(),
       
   185                  value("frontend/height", deskSize.height()*2/3).toUInt());
       
   186 
       
   187     // move the window to the center of the screen
       
   188     QPoint center = QApplication::desktop()->availableGeometry(-1).center();
       
   189     center.setX(center.x() - (Form->width()/2));
       
   190     center.setY(center.y() - (Form->height()/2));
       
   191     Form->move(center);
   183 }
   192 }
   184 
   193 
   185 void GameUIConfig::SaveOptions()
   194 void GameUIConfig::SaveOptions()
   186 {
   195 {
   187     setValue("video/resolution", Form->ui.pageOptions->CBResolution->currentText());
   196     setValue("video/resolution", Form->ui.pageOptions->CBResolution->currentText());