comparison main/main.cpp @ 297:ec08830e362e

* Avoid using last window placement if it is off-screen
author Chris Cannam
date Tue, 20 Jan 2009 18:12:40 +0000
parents 5c5a1ce79ad5
children 7872a95ee530
comparison
equal deleted inserted replaced
296:5c5a1ce79ad5 297:ec08830e362e
313 313
314 settings.beginGroup("MainWindow"); 314 settings.beginGroup("MainWindow");
315 QSize size = settings.value("size", QSize(width, height)).toSize(); 315 QSize size = settings.value("size", QSize(width, height)).toSize();
316 gui->resize(size); 316 gui->resize(size);
317 if (settings.contains("position")) { 317 if (settings.contains("position")) {
318 gui->move(settings.value("position").toPoint()); 318 QRect prevrect(settings.value("position").toPoint(), size);
319 if (!(available & prevrect).isEmpty()) {
320 gui->move(prevrect.topLeft());
321 }
319 } 322 }
320 settings.endGroup(); 323 settings.endGroup();
321 324
322 gui->show(); 325 gui->show();
323 326