aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
diff options
context:
space:
mode:
authorZackaryWelch <welch.zackary@gmail.com>2018-03-21 15:20:09 -0400
committerZackaryWelch <welch.zackary@gmail.com>2018-03-21 15:20:09 -0400
commite41f68cc4576b8581466051319c94a1e840049c4 (patch)
tree60b72d0c5f36593d030730f5472141834c9956f2 /src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
parentFix up the spacing/margins for the UI. (diff)
downloadlumina-e41f68cc4576b8581466051319c94a1e840049c4.tar.gz
lumina-e41f68cc4576b8581466051319c94a1e840049c4.tar.bz2
lumina-e41f68cc4576b8581466051319c94a1e840049c4.zip
Added a bookmarks menu, enabled on the MuPDF side.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
index 7c0fd323..63d25be4 100644
--- a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
+++ b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
@@ -315,3 +315,19 @@ void PrintWidget::fit(bool doFitting) {
//zoomFactor = this->transform().m11() * (float(printer->logicalDpiY()) / this->logicalDpiY());
}
+
+void PrintWidget::goToPosition(int pagenum, float x, float y) {
+ setCurrentPage(pagenum+1);
+ QPointF pt = this->transform().map(pages.at(pagenum)->pos());
+
+ if (zoomMode != FitInView) {
+ if(x != 0) {
+ QScrollBar *hsc = this->horizontalScrollBar();
+ hsc->setValue(int(pt.x() + x) - 10);
+ }
+ if(y != 0) {
+ QScrollBar *vsc = this->verticalScrollBar();
+ vsc->setValue(int(pt.y() + y) - 10);
+ }
+ }
+}
bgstack15