From 863be40cb04da3d8b8be2e0191b8714f474361fb Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 9 Aug 2023 03:59:50 +0300 Subject: [PATCH] okular: adjust to KGlobalSettings changes Signed-off-by: Ivailo Monev --- okular/ui/pageview.cpp | 6 +++--- okular/ui/propertiesdialog.cpp | 6 ++++-- okular/ui/thumbnaillist.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/okular/ui/pageview.cpp b/okular/ui/pageview.cpp index 8b596b0a..d70e3bec 100644 --- a/okular/ui/pageview.cpp +++ b/okular/ui/pageview.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -1756,7 +1756,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e ) int deltaY = d->mouseMidLastY - mouseY; // wrap mouse from top to bottom - const QRect mouseContainer = KGlobalSettings::desktopGeometry( this ); + const QRect mouseContainer = QApplication::desktop()->screenGeometry( this ); const int absDeltaY = abs(deltaY); if ( absDeltaY > mouseContainer.height() / 2 ) { @@ -1843,7 +1843,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e ) QPoint delta = d->mouseGrabPos - mousePos; // 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 const QPoint absDelta(abs(delta.x()), abs(delta.y())); if ( absDelta.y() > mouseContainer.height() / 2 ) diff --git a/okular/ui/propertiesdialog.cpp b/okular/ui/propertiesdialog.cpp index 46c2e24f..c76f80d5 100644 --- a/okular/ui/propertiesdialog.cpp +++ b/okular/ui/propertiesdialog.cpp @@ -21,12 +21,14 @@ #include #include #include +#include +#include + #include #include #include #include #include -#include #include // local includes @@ -182,7 +184,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc) if ( page2Layout ) width = qMax( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 ); // 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 ); resize(width, 1); diff --git a/okular/ui/thumbnaillist.cpp b/okular/ui/thumbnaillist.cpp index 63d7a5d6..e1b05614 100644 --- a/okular/ui/thumbnaillist.cpp +++ b/okular/ui/thumbnaillist.cpp @@ -15,6 +15,9 @@ #include #include #include +#include +#include + #include #include #include @@ -22,7 +25,6 @@ #include #include #include -#include // local includes #include "pagepainter.h" @@ -846,7 +848,7 @@ void ThumbnailListPrivate::mouseMoveEvent( QMouseEvent * e ) m_mouseGrabItem = getPageByNumber( m_pageCurrentlyGrabbed ); } // wrap mouse from top to bottom - const QRect mouseContainer = KGlobalSettings::desktopGeometry( this ); + const QRect mouseContainer = QApplication::desktop()->screenGeometry( this ); QPoint currentMousePos = QCursor::pos(); if ( currentMousePos.y() <= mouseContainer.top() + 4 ) {