From 5de99c3dbde4a614745276533f7d183e5e691d2c Mon Sep 17 00:00:00 2001 From: octaeder <102688820+octaeder@users.noreply.github.com> Date: Tue, 31 Dec 2024 16:58:35 +0100 Subject: [PATCH] fix pdf scroll bar --- src/pdfviewer/PDFDocument.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pdfviewer/PDFDocument.cpp b/src/pdfviewer/PDFDocument.cpp index 73a127cba..b172dbf0e 100644 --- a/src/pdfviewer/PDFDocument.cpp +++ b/src/pdfviewer/PDFDocument.cpp @@ -2149,6 +2149,7 @@ void PDFWidget::setGridSize(int gx, int gy, bool setAsDefault) getScrollArea()->goToPage(realPageIndex); if (pi == realPageIndex) reloadPage(); + emit changedScaleOption(scaleOption); //update(); } @@ -4465,8 +4466,14 @@ void PDFDocument::adjustScaleActions(autoScaleOption scaleOption) } else if (scaleOption == kFitWindow) { if (scrollArea->horizontalScrollBarPolicy() != Qt::ScrollBarAlwaysOff) scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - if (scrollArea->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff) - scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + if (scrollArea->getContinuous()) { + if (scrollArea->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOn) + scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + } + else { + if (scrollArea->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff) + scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + } } else { if (scrollArea->horizontalScrollBarPolicy() != Qt::ScrollBarAsNeeded) scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);