Skip to content
Permalink
Browse files

Move window to center

  • Loading branch information...
TotalCaesar659 committed Oct 8, 2019
1 parent 1c8ac05 commit b014ecc335c83968a388a6850475c58ea10d5dae
Showing with 2 additions and 2 deletions.
  1. +2 −2 Qt/mainwindow.cpp
@@ -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);

0 comments on commit b014ecc

Please sign in to comment.
You can’t perform that action at this time.