Skip to content

Commit

Permalink
fix split pose menus
Browse files Browse the repository at this point in the history
  • Loading branch information
azagoruyko committed Feb 24, 2024
1 parent 03f4168 commit a53d2ea
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions mayaModule/skeleposer/scripts/skeleposerEditor/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,20 +968,21 @@ def contextMenuEvent(self, event):
return

menu = QMenu(self)

menu.addAction("Add", self.addPoseItem, "Insert")

menu.addAction("Add", self.addPoseItem)
if self.selectedItems():
menu.addAction("Duplicate", self.duplicatePoseItem, "Ctrl-D")
menu.addAction("Duplicate", self.duplicatePoseItem)
menu.addSeparator()
menu.addAction("Remove", self.removePoseItem)

menu.addAction("Remove", self.removePoseItem, "Delete")
menu.popup(event.globalPos())

def keyPressEvent(self, event):
ctrl = event.modifiers() & Qt.ControlModifier

if ctrl:
print("ctrl", Qt.Key_D, event.key())
if event.key() == Qt.Key_D:

self.duplicatePoseItem()

elif event.key() == Qt.Key_Insert:
Expand Down Expand Up @@ -1085,30 +1086,14 @@ def __init__(self, **kwargs):
def contextMenuEvent(self, event):
menu = QMenu(self)

menu.addAction("Add", self.addPatternItem, "Insert")

menu.addAction("Add", self.addPatternItem)
if self.selectedItems():
menu.addAction("Duplicate", self.duplicatePatternItem, "Ctrl-D")
menu.addAction("Duplicate", self.duplicatePatternItem)
menu.addSeparator()
menu.addAction("Remove", self.removePatternItem)

menu.addAction("Remove", self.removePatternItem, "Delete")
menu.popup(event.globalPos())

def keyPressEvent(self, event):
ctrl = event.modifiers() & Qt.ControlModifier

if ctrl:
if event.key() == Qt.Key_D:
self.duplicatePatternItem()

elif event.key() == Qt.Key_Insert:
self.addPatternItem()

elif event.key() == Qt.Key_Delete:
self.removePatternItem()

else:
super(PatternTableWidget, self).keyPressEvent(event)

def validateItem(self, item):
self.blockSignals(True)
if item.column() == 1:
Expand Down

0 comments on commit a53d2ea

Please sign in to comment.