Remember maximized state of frontend window
authorWuzzy <Wuzzy2@mail.ru>
Tue, 06 Aug 2019 11:41:38 +0200
changeset 15303 976b3ed9b1fd
parent 15302 6afce21e60c3
child 15304 3bf780084c86
Remember maximized state of frontend window
QTfrontend/gameuiconfig.cpp
--- a/QTfrontend/gameuiconfig.cpp	Mon Aug 05 22:57:12 2019 +0200
+++ b/QTfrontend/gameuiconfig.cpp	Tue Aug 06 11:41:38 2019 +0200
@@ -230,6 +230,10 @@
     const QRect deskSize = HWApplication::desktop()->screenGeometry(-1);
     Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(),
                  value("frontend/height", qMin(qMax(deskSize.height()*2/3,600),deskSize.height())).toUInt());
+    if(value("frontend/maximized", false) == true)
+        Form->setWindowState(Form->windowState() | Qt::WindowMaximized);
+    else
+        Form->setWindowState(Form->windowState() & ~Qt::WindowMaximized);
 
     // move the window to the center of the screen
     QPoint center = HWApplication::desktop()->availableGeometry(-1).center();
@@ -260,6 +264,7 @@
     {
         setValue("frontend/width", Form->width());
         setValue("frontend/height", Form->height());
+        setValue("frontend/maximized", (Form->windowState() & Qt::WindowMaximized) != 0);
     }
     else
     {