diff options
author | Blaine | 2020-06-11 21:53:05 +0530 |
---|---|---|
committer | Blaine | 2020-06-11 21:53:05 +0530 |
commit | ffff3aba43422ccb74ead3b288bbf1935f7e52ac (patch) | |
tree | 16bf648b93a3ac6982774432605672cec35cfd1d /src/main/python/utils | |
parent | 530a2c5f1038d6ee280aaf99f47483a27ce7fbbd (diff) | |
download | Chemical-PFD-ffff3aba43422ccb74ead3b288bbf1935f7e52ac.tar.gz Chemical-PFD-ffff3aba43422ccb74ead3b288bbf1935f7e52ac.tar.bz2 Chemical-PFD-ffff3aba43422ccb74ead3b288bbf1935f7e52ac.zip |
restore scroll bars on side View
Diffstat (limited to 'src/main/python/utils')
-rw-r--r-- | src/main/python/utils/canvas.py | 21 | ||||
-rw-r--r-- | src/main/python/utils/fileWindow.py | 2 |
2 files changed, 1 insertions, 22 deletions
diff --git a/src/main/python/utils/canvas.py b/src/main/python/utils/canvas.py index 3c7ac67..fd06fb7 100644 --- a/src/main/python/utils/canvas.py +++ b/src/main/python/utils/canvas.py @@ -32,12 +32,6 @@ class canvas(customView): self.painter = customScene() self.painter.setBackgroundBrush(QBrush(Qt.white)) #set white background self.setScene = self.painter - # self = customView(self.painter, self) #create a viewport for the canvas board - - # self.layout = QHBoxLayout(self) #create the layout of the canvas, the canvas could just subclass QGView instead - # self.layout.addWidget(self, alignment=Qt.AlignCenter) - # self.layout.setContentsMargins(0, 0, 0, 0) - # self.setLayout(self.layout) #set initial paper size for the scene self.painter.setSceneRect(0, 0, *paperSizes[self._canvasSize][self._ppi]) @@ -55,21 +49,6 @@ class canvas(customView): #update view size self.setSceneRect(0, 0, width - frameWidth*2, height) - # use the available mdi area, also add padding - prect = self.parentMdiArea.rect() - width = width - height = height - - # add scrollbar size to width and height if they are visible, avoids clipping - if self.verticalScrollBar().isVisible(): - width += self.style().pixelMetric(QStyle.PM_ScrollBarExtent) - if self.horizontalScrollBar().isVisible(): - height += self.style().pixelMetric(QStyle.PM_ScrollBarExtent) - - #if view is visible use half of available width - #use minimum width required to fit the view - #set view dims - def resizeEvent(self, event): #overloaded function to also view size on window update self.adjustView() diff --git a/src/main/python/utils/fileWindow.py b/src/main/python/utils/fileWindow.py index 01710fb..2ef68c6 100644 --- a/src/main/python/utils/fileWindow.py +++ b/src/main/python/utils/fileWindow.py @@ -83,7 +83,7 @@ class fileWindow(QMdiSubWindow): width = parentRect.width() height = parentRect.height() self.moveSideViewCloseButton() - self.sideView.setSceneRect(0, 0, self.size().width()//2 - self.sideView.frameWidth(), self.size().height()//2) + self.sideView.resize(self.size().width()//2 - self.sideView.frameWidth(), self.size().height()) else: width = min(parentRect.width(), width + 100) |