okular: adjust to KGlobalSettings changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-09 03:59:50 +03:00
parent a4e6918c7c
commit 863be40cb0
3 changed files with 11 additions and 7 deletions

View file

@ -30,6 +30,7 @@
#include <qscrollbar.h>
#include <qtooltip.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qclipboard.h>
#include <kaction.h>
@ -40,7 +41,6 @@
#include <klocale.h>
#include <kfiledialog.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kinputdialog.h>
#include <kselectaction.h>
#include <ktoggleaction.h>
@ -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 )

View file

@ -21,12 +21,14 @@
#include <qsortfilterproxymodel.h>
#include <qtreeview.h>
#include <qtimer.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <kfiledialog.h>
#include <kicon.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <ksqueezedtextlabel.h>
#include <kglobalsettings.h>
#include <kurl.h>
// 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);

View file

@ -15,6 +15,9 @@
#include <qpainter.h>
#include <qscrollbar.h>
#include <qsizepolicy.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <klocale.h>
#include <kurl.h>
#include <kaction.h>
@ -22,7 +25,6 @@
#include <kiconloader.h>
#include <kactioncollection.h>
#include <kicon.h>
#include <kglobalsettings.h>
// 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 )
{