QTfrontend/gameuiconfig.cpp
changeset 15298 976b3ed9b1fd
parent 14961 575dbd7b5f43
child 15299 3bf780084c86
equal deleted inserted replaced
15297:6afce21e60c3 15298:976b3ed9b1fd
   228 {
   228 {
   229     // fill 2/3 of the screen desktop
   229     // fill 2/3 of the screen desktop
   230     const QRect deskSize = HWApplication::desktop()->screenGeometry(-1);
   230     const QRect deskSize = HWApplication::desktop()->screenGeometry(-1);
   231     Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(),
   231     Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(),
   232                  value("frontend/height", qMin(qMax(deskSize.height()*2/3,600),deskSize.height())).toUInt());
   232                  value("frontend/height", qMin(qMax(deskSize.height()*2/3,600),deskSize.height())).toUInt());
       
   233     if(value("frontend/maximized", false) == true)
       
   234         Form->setWindowState(Form->windowState() | Qt::WindowMaximized);
       
   235     else
       
   236         Form->setWindowState(Form->windowState() & ~Qt::WindowMaximized);
   233 
   237 
   234     // move the window to the center of the screen
   238     // move the window to the center of the screen
   235     QPoint center = HWApplication::desktop()->availableGeometry(-1).center();
   239     QPoint center = HWApplication::desktop()->availableGeometry(-1).center();
   236     center.setX(center.x() - (Form->width()/2));
   240     center.setX(center.x() - (Form->width()/2));
   237     center.setY(center.y() - (Form->height()/2));
   241     center.setY(center.y() - (Form->height()/2));
   258     emit frontendFullscreen(ffscr);
   262     emit frontendFullscreen(ffscr);
   259     if (!ffscr)
   263     if (!ffscr)
   260     {
   264     {
   261         setValue("frontend/width", Form->width());
   265         setValue("frontend/width", Form->width());
   262         setValue("frontend/height", Form->height());
   266         setValue("frontend/height", Form->height());
       
   267         setValue("frontend/maximized", (Form->windowState() & Qt::WindowMaximized) != 0);
   263     }
   268     }
   264     else
   269     else
   265     {
   270     {
   266         //resizeToConfigValues(); // TODO: why this has been made?
   271         //resizeToConfigValues(); // TODO: why this has been made?
   267     }
   272     }