diff options
author | Blaine | 2020-06-11 22:53:36 +0530 |
---|---|---|
committer | Blaine | 2020-06-11 22:53:36 +0530 |
commit | c0412bcf3853abeb6911c82aaf35125c25529277 (patch) | |
tree | 6de1ff534fee7df7e2f337f123938a400f4c9100 /src | |
parent | 737961c33741348a79987efbad35cf78c8d3a613 (diff) | |
download | Chemical-PFD-c0412bcf3853abeb6911c82aaf35125c25529277.tar.gz Chemical-PFD-c0412bcf3853abeb6911c82aaf35125c25529277.tar.bz2 Chemical-PFD-c0412bcf3853abeb6911c82aaf35125c25529277.zip |
fixed context menu
Diffstat (limited to 'src')
-rw-r--r-- | src/main/python/shapes/shapes.py | 6 | ||||
-rw-r--r-- | src/main/python/utils/canvas.py | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index e0263ab..6d06cba 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -525,10 +525,10 @@ class NodeItem(QGraphicsSvgItem): :return: """ contextMenu = QMenu() - addLableAction = contextMenu.addAction("add Label") - # addLableAction.triggered.connect(self.addLabel) + addLabelAction = contextMenu.addAction("add Label") + # addLabelAction.triggered.connect(self.addLabel) action = contextMenu.exec_(event.screenPos()) - if action == addLableAction: + if action == addLabelAction: self.label = ItemLabel(event.scenePos(), self) def __getstate__(self): diff --git a/src/main/python/utils/canvas.py b/src/main/python/utils/canvas.py index 88e3c43..480a2e1 100644 --- a/src/main/python/utils/canvas.py +++ b/src/main/python/utils/canvas.py @@ -37,7 +37,11 @@ class canvas(customView): self.painter.setSceneRect(0, 0, *paperSizes[self._canvasSize][self._ppi]) self.parentMdiArea = parentMdiArea self.parentFileWindow = parentFileWindow + self.customContextMenuRequested.connect(self.sideViewContextMenu) + def sideViewContextMenu(self, pos): + self.parentFileWindow.sideViewContextMenu(self.mapTo(self.parentFileWindow, pos)) + def resizeView(self, w, h): #helper function to resize canvas self.painter.setSceneRect(0, 0, w, h) |