Browse Source

Merge pull request #1492 from dogmaphobic/startingWindowSize

Starting window size
QGC4.4
Don Gagne 10 years ago
parent
commit
211bfba31d
  1. 13
      src/ui/MainWindow.cc

13
src/ui/MainWindow.cc

@ -235,15 +235,18 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) @@ -235,15 +235,18 @@ 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);
move((scrSize.width() - w) / 2, (scrSize.height() - h) / 2);
}
}

Loading…
Cancel
Save