diff options
| author | Al <gabriel.cortesi@outlook.com> | 2019-06-03 22:27:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-03 22:27:22 +0200 |
| commit | 355a2fbbee568723a05283f9a63ad9aa30040394 (patch) | |
| tree | d39dac6c4efb826f1268a9fb547d8bb3739dd4ba /src/main.cpp | |
| parent | 0ecd812035a26c196154be2e28dad65aebcbd8bd (diff) | |
| parent | 24aee49792c149f080eee37171ba049d0a618961 (diff) | |
Merge pull request #747 from isanae/splash-monitor
Display the splash screen on the same monitor as the main window
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index c012b037..6f304944 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -597,6 +597,17 @@ int runApplication(MOApplication &application, SingleInstance &instance, QPixmap pixmap(splashPath); QSplashScreen splash(pixmap); + + if (settings.contains("window_monitor")) { + const int monitor = settings.value("window_monitor").toInt(); + + if (monitor != -1) { + QDesktopWidget* desktop = QApplication::desktop(); + const QPoint center = desktop->availableGeometry(monitor).center(); + splash.move(center - splash.rect().center()); + } + } + splash.show(); splash.activateWindow(); |
