summaryrefslogtreecommitdiff
path: root/src/main/python/utils/canvas.py
diff options
context:
space:
mode:
authorBlaine2020-04-28 22:27:41 +0530
committerBlaine2020-04-28 22:27:41 +0530
commita64e5e224d29636a5d9e80b5760da7993d795bcd (patch)
treef099bcf085d172a59527417371717e0fe6a81f59 /src/main/python/utils/canvas.py
parent4f47a375887aecb2778800f375f4c4e037bf26a6 (diff)
downloadChemical-PFD-a64e5e224d29636a5d9e80b5760da7993d795bcd.tar.gz
Chemical-PFD-a64e5e224d29636a5d9e80b5760da7993d795bcd.tar.bz2
Chemical-PFD-a64e5e224d29636a5d9e80b5760da7993d795bcd.zip
The Fix?
Diffstat (limited to 'src/main/python/utils/canvas.py')
-rw-r--r--src/main/python/utils/canvas.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/python/utils/canvas.py b/src/main/python/utils/canvas.py
index b158b99..8bac15f 100644
--- a/src/main/python/utils/canvas.py
+++ b/src/main/python/utils/canvas.py
@@ -55,19 +55,19 @@ class canvas(QWidget):
frameWidth = self.view.frameWidth()
self.view.setSceneRect(0, 0, width - frameWidth*2, height)
# give the view some time to adjust itself
- QApplication.processEvents()
- prect = self.parent().parentWidget().parentWidget().size()
- width = width + frameWidth*2
- height = height + frameWidth * 2
+ prect = self.parent().parentWidget().parentWidget().parentWidget().rect()
+ width = width + 50
+ height = height + 100
if self.view.verticalScrollBar().isVisible():
width += self.style().pixelMetric(QStyle.PM_ScrollBarExtent)
if self.view.horizontalScrollBar().isVisible():
height += self.style().pixelMetric(QStyle.PM_ScrollBarExtent)
- self.view.setFixedWidth(min(prect.width() - frameWidth*2, width))
- self.view.setFixedHeight(min(prect.height() - frameWidth*2, height))
+ self.view.setFixedWidth(min(prect.width() - 50, width))
+ self.view.setFixedHeight(min(prect.height() - 100, height))
# self.resize(width + frameWidth * 2, height + frameWidth * 2)
+
def resizeEvent(self, event):
#overloaded function to also view size on window update
self.adjustView()