blackies patch to fix the tabbox position for dual screens setups
svn path=/trunk/kdebase/kwin/; revision=130535
This commit is contained in:
parent
3cba456ff4
commit
1f02fc2275
1 changed files with 13 additions and 3 deletions
16
tabbox.cpp
16
tabbox.cpp
|
@ -15,6 +15,9 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
||||||
#include <kglobal.h>
|
#include <kglobal.h>
|
||||||
#include <kconfig.h>
|
#include <kconfig.h>
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
|
#include <qapplication.h>
|
||||||
|
#include <qdesktopwidget.h>
|
||||||
|
#include <qcursor.h>
|
||||||
|
|
||||||
// specify externals before namespace
|
// specify externals before namespace
|
||||||
|
|
||||||
|
@ -89,10 +92,17 @@ void TabBox::reset()
|
||||||
desk = workspace()->currentDesktop();
|
desk = workspace()->currentDesktop();
|
||||||
}
|
}
|
||||||
|
|
||||||
int w = QMAX( wmax + 20, qApp->desktop()->width()/3 );
|
|
||||||
setGeometry( (qApp->desktop()->width()-w)/2,
|
QDesktopWidget* desktop = qApp->desktop();
|
||||||
qApp->desktop()->height()/2-fontMetrics().height()*2-10,
|
int screen = desktop->screenNumber( QCursor::pos() );
|
||||||
|
QRect r = desktop->screenGeometry(screen);
|
||||||
|
|
||||||
|
|
||||||
|
int w = QMAX( wmax + 20, r.width()/3 );
|
||||||
|
setGeometry( (r.width()-w)/2 + r.x(),
|
||||||
|
r.height()/2-fontMetrics().height()*2-10 + r.y(),
|
||||||
w, fontMetrics().height()*4 + 20 );
|
w, fontMetrics().height()*4 + 20 );
|
||||||
|
|
||||||
wmax = QMIN( wmax, width() - 12 );
|
wmax = QMIN( wmax, width() - 12 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue