diff options
| author | 2008-10-07 14:14:21 +0000 | |
|---|---|---|
| committer | 2008-10-07 14:14:21 +0000 | |
| commit | 09c0f91a14d6cade6c1f2bfc926d024f483bc7e5 (patch) | |
| tree | 0bb615166159e783215e53a022fed6d96376a4d9 /src/modules/options/dialog.cpp | |
| parent | fix for #195 upported to 4.0 (diff) | |
| download | KVIrc-09c0f91a14d6cade6c1f2bfc926d024f483bc7e5.tar.gz KVIrc-09c0f91a14d6cade6c1f2bfc926d024f483bc7e5.tar.bz2 KVIrc-09c0f91a14d6cade6c1f2bfc926d024f483bc7e5.zip | |
some fixes to options windows positioning and size;
global fix for hbox/vbox margin and spacing widths
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2665 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/options/dialog.cpp')
| -rw-r--r-- | src/modules/options/dialog.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/modules/options/dialog.cpp b/src/modules/options/dialog.cpp index 308ffe1a2..d1ae6cf16 100644 --- a/src/modules/options/dialog.cpp +++ b/src/modules/options/dialog.cpp @@ -48,6 +48,7 @@ #include <QCloseEvent> #include <QShortcut> #include <QHeaderView> +#include <QDesktopWidget> //FIXME: some headers must be hidden @@ -280,6 +281,30 @@ KviOptionsDialog::~KviOptionsDialog() g_pOptionsDialogDict->remove(m_szGroup); } +void KviOptionsDialog::showEvent(QShowEvent *e) +{ + QRect r = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); + + int w = r.width(); + int h = r.height(); + + int ww = width(); + int wh = height(); + + if(w < 800) + { + // 640x480 + if(ww < 630)ww = 630; + } else { + if(ww < 770)ww = 770; + } + + setGeometry((w - ww) / 2,(h - wh) / 2,ww,wh); + + move((r.width() - width())/2,(r.height() - height())/2); + + QDialog::showEvent(e); +} void KviOptionsDialog::searchLineEditTextChanged(const QString &) { |
