diff options
author | Blaine | 2020-05-06 20:39:07 +0530 |
---|---|---|
committer | Blaine | 2020-05-06 20:39:07 +0530 |
commit | 6c5a39579c737d0054e29403ec0a045cc6a6d52a (patch) | |
tree | 005e4e951099d84a9538555fcbd32ba7ed277069 /src/main/python | |
parent | ecb94d6b121d0c3c9d79dc58140535432cfef973 (diff) | |
download | Chemical-PFD-6c5a39579c737d0054e29403ec0a045cc6a6d52a.tar.gz Chemical-PFD-6c5a39579c737d0054e29403ec0a045cc6a6d52a.tar.bz2 Chemical-PFD-6c5a39579c737d0054e29403ec0a045cc6a6d52a.zip |
revert close button move
Diffstat (limited to 'src/main/python')
-rw-r--r-- | src/main/python/utils/fileWindow.py | 10 | ||||
-rw-r--r-- | src/main/python/utils/graphics.py | 16 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/main/python/utils/fileWindow.py b/src/main/python/utils/fileWindow.py index 24d6a6d..2fb6abb 100644 --- a/src/main/python/utils/fileWindow.py +++ b/src/main/python/utils/fileWindow.py @@ -142,11 +142,11 @@ class fileWindow(QMdiSubWindow): return False def moveSideViewCloseButton(self): - x = self.sideView.width() - 5 - print(x) - if self.sideView.verticalScrollBar().isVisible(): - x -= self.style().pixelMetric(QStyle.PM_ScrollBarExtent) - self.sideViewCloseButton.move(x, 5) + # x = self.rect().width()//2 - 5 + # if self.sideView.verticalScrollBar().isVisible(): + # x -= self.style().pixelMetric(QStyle.PM_ScrollBarExtent) + # self.sideViewCloseButton.move(x, 5) + self.sideViewCloseButton.move(5, 5) @property def sideViewTab(self): diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index aed7eed..8c87b96 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -8,19 +8,27 @@ class customView(QGraphicsView): super(customView, self).__init__(scene, parent) else: super(customView, self).__init__(parent) - self.zoom = 1 + self._zoom = 1 self.setDragMode(True) def wheelEvent(self, QWheelEvent): if Qt.ControlModifier: - temp = self.zoom if QWheelEvent.source() == Qt.MouseEventNotSynthesized: if self.zoom + QWheelEvent.angleDelta().y()/2880 > 0.1: self.zoom += QWheelEvent.angleDelta().y()/2880 else: if self.zoom + QWheelEvent.pixelDelta().y() > 0.1: self.zoom += QWheelEvent.angleDelta().y() - self.scale(self.zoom / temp, self.zoom / temp) QWheelEvent.accept() else: - return super().wheelEvent(self, QWheelEvent)
\ No newline at end of file + return super().wheelEvent(self, QWheelEvent) + + @property + def zoom(self): + return self._zoom + + @zoom.setter + def zoom(self, value): + temp = self.zoom + self._zoom = value + self.scale(self.zoom / temp, self.zoom / temp)
\ No newline at end of file |