Disable remove ROI menu action in handle context menu (#1197)

This commit is contained in:
Kenneth Lyons 2020-05-10 08:39:17 -07:00 committed by GitHub
parent 720fa5f3c2
commit 5bebf697b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -758,6 +758,9 @@ class ROI(GraphicsObject):
remAct.triggered.connect(self.removeClicked)
self.menu.addAction(remAct)
self.menu.remAct = remAct
# ROI menu may be requested when showing the handle context menu, so
# return the menu but disable it if the ROI isn't removable
self.menu.setEnabled(self.contextMenuEnabled())
return self.menu
def removeClicked(self):