|
|
@ -28,10 +28,10 @@ class PDFLabel(QLabel): |
|
|
|
parentMargins[0]*2 + scrollBarWidth |
|
|
|
|
|
|
|
idealWidth = self.parent.width() - totalMargin |
|
|
|
print(idealWidth) |
|
|
|
# print(idealWidth) |
|
|
|
pixSize = self.pixmap().size() |
|
|
|
print(pixSize) |
|
|
|
print((self.parent.scrollAreaContents.size())) |
|
|
|
# print(pixSize) |
|
|
|
# print((self.parent.scrollAreaContents.size())) |
|
|
|
|
|
|
|
pixSize.scale(idealWidth, 1000000, Qt.KeepAspectRatio) |
|
|
|
|
|
|
@ -48,6 +48,9 @@ class PDFViewer(QScrollArea): |
|
|
|
self.setWidget(self.scrollAreaContents) |
|
|
|
self.setWidgetResizable(True) |
|
|
|
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) |
|
|
|
# set a fixed background colour |
|
|
|
# on some OSes (Mac, Haiku) it is grey automatically but not on KDE |
|
|
|
self.setStyleSheet('PDFViewer {background-color: #D8D8D8}') |
|
|
|
|
|
|
|
self.scrollAreaContents.setLayout(self.scrollAreaLayout) |
|
|
|
self.pixmapList = [] |
|
|
|