Mercurial > hg > sonic-visualiser
changeset 625:763b1fbeb31c with-dependencies
Merge from the default branch
author | Chris Cannam |
---|---|
date | Tue, 24 Sep 2013 11:06:29 +0100 |
parents | d4d2f9319155 (current diff) c0a20cd1a9ff (diff) |
children | 1262ce219e0c |
files | main/main.cpp |
diffstat | 2 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/main/MainWindow.cpp Mon Sep 16 17:40:41 2013 +0100 +++ b/main/MainWindow.cpp Tue Sep 24 11:06:29 2013 +0100 @@ -3094,8 +3094,11 @@ QSettings settings; settings.beginGroup("MainWindow"); - settings.setValue("size", size()); - settings.setValue("position", pos()); + settings.setValue("maximised", isMaximized()); + if (!isMaximized()) { + settings.setValue("size", size()); + settings.setValue("position", pos()); + } settings.endGroup(); if (m_preferencesDialog &&
--- a/main/main.cpp Mon Sep 16 17:40:41 2013 +0100 +++ b/main/main.cpp Tue Sep 24 11:06:29 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();