diff options
author | Blaine | 2020-06-19 17:29:20 +0530 |
---|---|---|
committer | Blaine | 2020-06-19 17:29:20 +0530 |
commit | 26dbadc8840cbc5130411ac43f781f82e276bf7e (patch) | |
tree | eded0be2e6b9dd4907d394560e1b87441204ee2c | |
parent | 56471d91921916feb033fba55c6902800ac52b65 (diff) | |
download | Chemical-PFD-26dbadc8840cbc5130411ac43f781f82e276bf7e.tar.gz Chemical-PFD-26dbadc8840cbc5130411ac43f781f82e276bf7e.tar.bz2 Chemical-PFD-26dbadc8840cbc5130411ac43f781f82e276bf7e.zip |
cleanup shapes context menu
-rw-r--r-- | src/main/python/shapes/shapes.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 3efabbc..ca6490c 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -634,15 +634,12 @@ class NodeItem(QGraphicsSvgItem): """ # create a menu and add action contextMenu = QMenu() - addLableAction = contextMenu.addAction("add Label") # add action for text label - contextMenu.addAction("Rotate right", lambda : setattr(self, "rotation", self.rotation + 1)) - contextMenu.addAction("Rotate left", lambda : setattr(self, "rotation", self.rotation - 1)) + contextMenu.addAction("Add Label", lambda : setattr(self, "label", ItemLabel(self))) + contextMenu.addAction("Rotate right(E)", lambda : setattr(self, "rotation", self.rotation + 1)) + contextMenu.addAction("Rotate left(Q)", lambda : setattr(self, "rotation", self.rotation - 1)) contextMenu.addAction("Flip Horizontally", lambda: setattr(self, "flipH", not self.flipH)) contextMenu.addAction("Flip Vertically", lambda: setattr(self, "flipV", not self.flipV)) action = contextMenu.exec_(event.screenPos()) - # check for label action and add text label as child - if action == addLableAction: - self.label = ItemLabel(self) # text label as child def __getstate__(self): return { |