Move window to center

This commit is contained in:
TotalCaesar659 2019-10-08 04:53:06 +03:00 committed by GitHub
parent 1c8ac05b06
commit b014ecc335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,9 +25,9 @@ MainWindow::MainWindow(QWidget *parent, bool fullscreen) :
QDesktopWidget *desktop = QApplication::desktop();
int screenNum = QProcessEnvironment::systemEnvironment().value("SDL_VIDEO_FULLSCREEN_HEAD", "0").toInt();
// Move window to top left coordinate of selected screen
// Move window to the center of selected screen
QRect rect = desktop->screenGeometry(screenNum);
move(rect.topLeft());
move((rect.width()-frameGeometry().width()) / 4, (rect.height()-frameGeometry().height()) / 4);
SetGameTitle("");
emugl = new MainUI(this);