From fd45f39db16a7ee308976dc7813ef5d1bfb3ffaa Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Tue, 21 Apr 2015 20:20:07 -0400 Subject: [PATCH] Sensible initial window size. --- src/ui/MainWindow.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 6d203fefc..1f17ad145 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -235,15 +235,17 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) else { // Adjust the size - const int screenWidth = QApplication::desktop()->width(); - const int screenHeight = QApplication::desktop()->height(); - if (screenWidth < 1500) + QScreen* scr = QApplication::primaryScreen(); + QSize scrSize = scr->availableSize(); + if (scrSize.width() <= 1280) { - resize(screenWidth, screenHeight - 80); + resize(scrSize.width(), scrSize.height()); } else { - resize(screenWidth*0.67f, qMin(screenHeight, (int)(screenWidth*0.67f*0.67f))); + int w = scrSize.width() > 1600 ? 1600 : scrSize.width(); + int h = scrSize.height() > 800 ? 800 : scrSize.height(); + resize(w, h); } } -- 2.22.0