Skip to content

Commit

Permalink
fix pdf scroll bar
Browse files Browse the repository at this point in the history
  • Loading branch information
octaeder committed Dec 31, 2024
1 parent dd5aabd commit 5de99c3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/pdfviewer/PDFDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2149,6 +2149,7 @@ void PDFWidget::setGridSize(int gx, int gy, bool setAsDefault)
getScrollArea()->goToPage(realPageIndex);
if (pi == realPageIndex)
reloadPage();
emit changedScaleOption(scaleOption);
//update();
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5de99c3

Please sign in to comment.