Skip to content

Commit

Permalink
scroll hand cursor with hot spot marked (#2480)
Browse files Browse the repository at this point in the history
  • Loading branch information
octaeder authored Jul 17, 2022
1 parent 4ffab8f commit edbd560
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 1 deletion.
84 changes: 84 additions & 0 deletions images-ng/focusedhand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
<file>images-ng/label.svg</file>
<file>images-ng/label_dm.svg</file>
<file>images-ng/executeMacro.svg</file>
<file>images-ng/focusedhand.svg</file>
<file>images-ng/classic/subscript_dm.svg</file>
<file>images-ng/classic/superscript_dm.svg</file>
<file>images-ng/classic/dfrac_dm.svg</file>
Expand Down
4 changes: 3 additions & 1 deletion src/pdfviewer/PDFDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ void PDFMovie::seekDialog()
QCursor *PDFWidget::magnifierCursor = nullptr;
QCursor *PDFWidget::zoomInCursor = nullptr;
QCursor *PDFWidget::zoomOutCursor = nullptr;
QCursor *PDFWidget::focusedHandCursor = nullptr;

PDFWidget::PDFWidget(bool embedded)
: QLabel()
Expand Down Expand Up @@ -614,6 +615,7 @@ PDFWidget::PDFWidget(bool embedded)
magnifierCursor = new QCursor(QPixmap(getRealIconFile("magnifier")).scaled(32, 32, Qt::KeepAspectRatio, Qt::SmoothTransformation),10,10);
zoomInCursor = new QCursor(QPixmap(getRealIconFile("zoom-in-magnifier")).scaled(32, 32, Qt::KeepAspectRatio, Qt::SmoothTransformation),12,12);
zoomOutCursor = new QCursor(QPixmap(getRealIconFile("zoom-out-magnifier")).scaled(32, 32, Qt::KeepAspectRatio, Qt::SmoothTransformation),12,12);
focusedHandCursor = new QCursor(QPixmap(getRealIconFile("focusedhand")).scaled(32, 32, Qt::KeepAspectRatio, Qt::SmoothTransformation),8,13);
}

ctxZoomInAction = new QAction(tr("Zoom In"), this);
Expand Down Expand Up @@ -1559,7 +1561,7 @@ void PDFWidget::updateCursor()
setCursor(Qt::ArrowCursor);
}
else
setCursor(Qt::OpenHandCursor);
setCursor(*focusedHandCursor);
}
break;
case kMagnifier: {
Expand Down
1 change: 1 addition & 0 deletions src/pdfviewer/PDFDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ public slots:
static QCursor *magnifierCursor;
static QCursor *zoomInCursor;
static QCursor *zoomOutCursor;
static QCursor *focusedHandCursor;

mutable QSizeF maxPageSize; //cache pageSize
mutable QRectF horizontalTextRange;
Expand Down

0 comments on commit edbd560

Please sign in to comment.