Port away from KGlobalSettings::desktopGeometry().

This commit is contained in:
Arnold Dumas 2014-09-28 14:14:19 +02:00
parent a6db7a2655
commit dc74543bac
3 changed files with 9 additions and 7 deletions

View file

@ -33,6 +33,7 @@
#include <qclipboard.h> #include <qclipboard.h>
#include <qmenu.h> #include <qmenu.h>
#include <QInputDialog> #include <QInputDialog>
#include <qdesktopwidget.h>
#include <kaction.h> #include <kaction.h>
#include <kactionmenu.h> #include <kactionmenu.h>
@ -41,7 +42,6 @@
#include <klocale.h> #include <klocale.h>
#include <kfiledialog.h> #include <kfiledialog.h>
#include <kglobal.h> #include <kglobal.h>
#include <kglobalsettings.h>
#include <kselectaction.h> #include <kselectaction.h>
#include <ktoggleaction.h> #include <ktoggleaction.h>
#include <QtCore/QDebug> #include <QtCore/QDebug>
@ -1866,7 +1866,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e )
int deltaY = d->mouseMidLastY - mouseY; int deltaY = d->mouseMidLastY - mouseY;
// wrap mouse from top to bottom // wrap mouse from top to bottom
const QRect mouseContainer = KGlobalSettings::desktopGeometry( this ); const QRect mouseContainer = QApplication::desktop()->screenGeometry( this );
const int absDeltaY = abs(deltaY); const int absDeltaY = abs(deltaY);
if ( absDeltaY > mouseContainer.height() / 2 ) if ( absDeltaY > mouseContainer.height() / 2 )
{ {
@ -1953,7 +1953,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e )
QPoint delta = d->mouseGrabPos - mousePos; QPoint delta = d->mouseGrabPos - mousePos;
// wrap mouse from top to bottom // wrap mouse from top to bottom
const QRect mouseContainer = KGlobalSettings::desktopGeometry( this ); const QRect mouseContainer = QApplication::desktop()->screenGeometry( this );
// If the delta is huge it probably means we just wrapped in that direction // If the delta is huge it probably means we just wrapped in that direction
const QPoint absDelta(abs(delta.x()), abs(delta.y())); const QPoint absDelta(abs(delta.x()), abs(delta.y()));
if ( absDelta.y() > mouseContainer.height() / 2 ) if ( absDelta.y() > mouseContainer.height() / 2 )

View file

@ -10,6 +10,8 @@
#include "propertiesdialog.h" #include "propertiesdialog.h"
// qt/kde includes // qt/kde includes
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qfile.h> #include <qfile.h>
#include <qlayout.h> #include <qlayout.h>
#include <qformlayout.h> #include <qformlayout.h>
@ -27,7 +29,6 @@
#include <klocale.h> #include <klocale.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <ksqueezedtextlabel.h> #include <ksqueezedtextlabel.h>
#include <kglobalsettings.h>
#include <kurl.h> #include <kurl.h>
// local includes // local includes
@ -171,7 +172,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc)
// width = qMax( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 ); // width = qMax( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 );
width = qMax( width, page2Layout->sizeHint().width() + 31 ); width = qMax( width, page2Layout->sizeHint().width() + 31 );
// stay inside the 2/3 of the screen width // stay inside the 2/3 of the screen width
QRect screenContainer = KGlobalSettings::desktopGeometry( this ); QRect screenContainer = QApplication::desktop()->screenGeometry( this );
width = qMin( width, 2*screenContainer.width()/3 ); width = qMin( width, 2*screenContainer.width()/3 );
resize(width, 1); resize(width, 1);

View file

@ -10,6 +10,8 @@
#include "thumbnaillist.h" #include "thumbnaillist.h"
// qt/kde includes // qt/kde includes
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qevent.h> #include <qevent.h>
#include <qtimer.h> #include <qtimer.h>
#include <qpainter.h> #include <qpainter.h>
@ -22,7 +24,6 @@
#include <kiconloader.h> #include <kiconloader.h>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kicon.h> #include <kicon.h>
#include <kglobalsettings.h>
// local includes // local includes
#include "pagepainter.h" #include "pagepainter.h"
@ -848,7 +849,7 @@ void ThumbnailListPrivate::mouseMoveEvent( QMouseEvent * e )
m_mouseGrabItem = getPageByNumber( m_pageCurrentlyGrabbed ); m_mouseGrabItem = getPageByNumber( m_pageCurrentlyGrabbed );
} }
// wrap mouse from top to bottom // wrap mouse from top to bottom
const QRect mouseContainer = KGlobalSettings::desktopGeometry( this ); const QRect mouseContainer = QApplication::desktop()->screenGeometry( this );
QPoint currentMousePos = QCursor::pos(); QPoint currentMousePos = QCursor::pos();
if ( currentMousePos.y() <= mouseContainer.top() + 4 ) if ( currentMousePos.y() <= mouseContainer.top() + 4 )
{ {