UI Nits: Geometry and setUnifiedTitleAndToolBar

The restore / set geometry for the config dialog and mainwindow
was 'adjusted' by setUnifiedTitleAndToolBarOnMac. This meant
that when restoring geometry at startup the window would gradually
decrease in size (by roughly 42 pixels).
This commit is contained in:
Mark Liversedge
2012-12-10 08:51:41 +00:00
parent 9b0b193ed3
commit a520da1f2a
2 changed files with 9 additions and 7 deletions

View File

@@ -149,6 +149,13 @@ MainWindow::MainWindow(const QDir &home) :
setAttribute(Qt::WA_DeleteOnClose);
// need to restore geometry before setUnifiedToolBar.. on Mac
appsettings->setValue(GC_SETTINGS_LAST, home.dirName());
QVariant geom = appsettings->value(this, GC_SETTINGS_MAIN_GEOM);
if (geom == QVariant()) resize(640, 480);
else setGeometry(geom.toRect());
#ifdef Q_OS_MAC // MAC NATIVE TOOLBAR
static CocoaInitializer cocoaInitializer; // we only need one
setUnifiedTitleAndToolBarOnMac(true);
@@ -238,11 +245,6 @@ MainWindow::MainWindow(const QDir &home) :
setContentsMargins(0,0,0,0);
setAcceptDrops(true);
appsettings->setValue(GC_SETTINGS_LAST, home.dirName());
QVariant geom = appsettings->value(this, GC_SETTINGS_MAIN_GEOM);
if (geom == QVariant()) resize(640, 480);
else setGeometry(geom.toRect());
GCColor *GCColorSet = new GCColor(this); // get/keep colorset
GCColorSet->colorSet(); // shut up the compiler