diff options
| author | 2008-06-30 01:51:18 +0000 | |
|---|---|---|
| committer | 2008-06-30 01:51:18 +0000 | |
| commit | d19516de5229b48a32c44d38b9f611789119e960 (patch) | |
| tree | ec22f2e3501032658a76fa5aff6fbea946a0d228 /src/modules/setup/setupwizard.cpp | |
| parent | fixed crash in first-setup wizard (diff) | |
| download | KVIrc-d19516de5229b48a32c44d38b9f611789119e960.tar.gz KVIrc-d19516de5229b48a32c44d38b9f611789119e960.tar.bz2 KVIrc-d19516de5229b48a32c44d38b9f611789119e960.zip | |
fixed first-run window positions of wizard and mainwindow on multi-monitor systems
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1968 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/setup/setupwizard.cpp')
| -rw-r--r-- | src/modules/setup/setupwizard.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/setup/setupwizard.cpp b/src/modules/setup/setupwizard.cpp index 200b4c25e..1c9895126 100644 --- a/src/modules/setup/setupwizard.cpp +++ b/src/modules/setup/setupwizard.cpp @@ -658,8 +658,11 @@ KviSetupWizard::~KviSetupWizard() void KviSetupWizard::showEvent(QShowEvent *e) { - int w = QApplication::desktop()->width(); - int h = QApplication::desktop()->height(); + int primary_screen = g_pApp->desktop()->primaryScreen(); + QRect r = g_pApp->desktop()->screenGeometry(primary_screen); + + int w = r.width(); + int h = r.height(); int ww = width(); int wh = height(); @@ -672,9 +675,7 @@ void KviSetupWizard::showEvent(QShowEvent *e) if(ww < 770)ww = 770; } - //wh = sizeHint().height(); - - setGeometry((w - ww) / 2,(h - wh) / 2,ww,wh); + setGeometry(r.left() + (w - ww) / 2, r.top() + (h - wh) / 2,ww,wh); KviTalWizard::showEvent(e); } |
