aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_widget.cpp
diff options
context:
space:
mode:
authorGravatar Fabio Bas2008-10-06 09:01:39 +0000
committerGravatar Fabio Bas2008-10-06 09:01:39 +0000
commite28605ac6addc6b71166374e548df20ac573a899 (patch)
treeda05df995844bac68f0bd3414fae4b318d006b12 /src/modules/objects/class_widget.cpp
parentsome work on the statusbar (far from being complete) (diff)
downloadKVIrc-e28605ac6addc6b71166374e548df20ac573a899.tar.gz
KVIrc-e28605ac6addc6b71166374e548df20ac573a899.tar.bz2
KVIrc-e28605ac6addc6b71166374e548df20ac573a899.zip
hopefully fixed all the dual-screen setup dialog centering problems
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2660 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects/class_widget.cpp')
-rw-r--r--src/modules/objects/class_widget.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/modules/objects/class_widget.cpp b/src/modules/objects/class_widget.cpp
index f670ad538..2ba146bb0 100644
--- a/src/modules/objects/class_widget.cpp
+++ b/src/modules/objects/class_widget.cpp
@@ -1059,8 +1059,10 @@ bool KviKvsObject_widget::function_fontMetricsHeight(KviKvsObjectFunctionCall *
bool KviKvsObject_widget::function_screenResolution(KviKvsObjectFunctionCall * c)
{
KviKvsArray * a = new KviKvsArray();
- a->set(0,new KviKvsVariant((kvs_int_t)g_pApp->desktop()->width()));
- a->set(1,new KviKvsVariant((kvs_int_t)g_pApp->desktop()->height()));
+ QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen());
+
+ a->set(0,new KviKvsVariant((kvs_int_t)rect.width()));
+ a->set(1,new KviKvsVariant((kvs_int_t)rect.height()));
c->returnValue()->setArray(a);
return true;
}
@@ -1185,7 +1187,12 @@ bool KviKvsObject_widget::function_mapFromGlobal(KviKvsObjectFunctionCall *c)
bool KviKvsObject_widget::function_centerToScreen(KviKvsObjectFunctionCall *c)
{
- if(widget()) widget()->move((g_pApp->desktop()->width() - widget()->width())/2,(g_pApp->desktop()->height() - widget()->height())/2);
+ if(widget())
+ {
+ QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen());
+ widget()->move((rect.width() - widget()->width())/2,(rect.height() - widget()->height())/2);
+ }
+
return true;
}