diff main/main.cpp @ 624:c0a20cd1a9ff

If maximised on exit, don't save (maximised) geometry but instead mark as maximised and maximise on restart
author Chris Cannam
date Fri, 20 Sep 2013 16:38:00 +0100
parents fba4839f8811
children 763b1fbeb31c 6d8a76bd91a7
line wrap: on
line diff
--- a/main/main.cpp	Mon Sep 16 15:47:42 2013 +0100
+++ b/main/main.cpp	Fri Sep 20 16:38:00 2013 +0100
@@ -363,14 +363,21 @@
     if (width > height * 2) width = height * 2;
 
     settings.beginGroup("MainWindow");
+
     QSize size = settings.value("size", QSize(width, height)).toSize();
     gui->resizeConstrained(size);
+
     if (settings.contains("position")) {
         QRect prevrect(settings.value("position").toPoint(), size);
         if (!(available & prevrect).isEmpty()) {
             gui->move(prevrect.topLeft());
         }
     }
+
+    if (settings.value("maximised", false).toBool()) {
+        gui->setWindowState(Qt::WindowMaximized);
+    }
+
     settings.endGroup();
     
     gui->show();