# Path: lazylyst/CustomWidgets.py
# class HoverLineEdit(QtWidgets.QLineEdit):
#     hoverOut = QtCore.pyqtSignal()
#     
#     def __init__(self, parent=None):
#         super(HoverLineEdit, self).__init__(parent)   
#         self.changeState=False        
#         self.textChanged.connect(self.updateChangeState)
#         
#     def leaveEvent(self, ev):
#         # Only emit if the text was changed
#         if self.changeState:
#             self.hoverOut.emit()
#             self.changeState=False
#     
#     def updateChangeState(self,ev):
#         self.changeState=True
# 
# class KeyBindLineEdit(QtWidgets.QLineEdit):
#     keyPressed=QtCore.pyqtSignal(str)
#     
#     def __init__(self, parent=None):
#         super(KeyBindLineEdit, self).__init__(parent)    
#         self.MOD_MASK = (Qt.CTRL | Qt.ALT | Qt.SHIFT | Qt.META)
#     
#     # If any usual key bind was pressed, return the human recognizable string
#     def keyPressEvent(self, ev):
#         keyname = keyPressToString(ev)
#         if keyname==None:
#             return
#         self.keyPressed.emit(keyname)
# 
# class KeyListWidget(QtWidgets.QListWidget):       
#     # Return signal if key was pressed while in focus
#     keyPressedSignal = QtCore.pyqtSignal()  
#     
#     def __init__(self, parent=None):
#         super(KeyListWidget, self).__init__(parent)
#     
#     # Update this widgets last pressed key, and return a signal
#     def keyPressEvent(self, ev):
#         self.key=ev.key()
#         if self.key not in [Qt.Key_Delete]:
#             return
#         self.keyPressedSignal.emit()
#         
#     # Deselect all items if in a blank space
#     def mousePressEvent(self, ev):
#         if self.itemAt(ev.pos()) is None:
#             self.clearSelection()
#         QtWidgets.QListWidget.mousePressEvent(self, ev)
#     
#     # Ensure that key presses are sent to the widget which the mouse is hovering over
#     def enterEvent(self,ev):
#         super(KeyListWidget, self).enterEvent(ev)
#         self.setFocus()
# 
#     # Return a lists entries in the order which is appears
#     def visualListOrder(self):
#         txt=np.array([self.item(i).text() for i in range(self.count())])
#         args=np.array([self.indexFromItem(self.item(i)).row() for i in range(self.count())])
#         return list(txt[np.argsort(args)])


from PyQt5 import QtCore, QtGui, QtWidgets
from lazylyst.CustomWidgets import HoverLineEdit, KeyBindLineEdit, KeyListWidget
        font.setBold(False)
        font.setWeight(50)
        self.actInputLabel.setFont(font)
        self.actInputLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.actInputLabel.setObjectName("actInputLabel")
        self.actReturnLayout.addWidget(self.actInputLabel, 0, 2, 1, 1)
        self.actReturnLabel = QtWidgets.QLabel(actionDialog)
        font = QtGui.QFont()
        font.setBold(False)
        font.setWeight(50)
        self.actReturnLabel.setFont(font)
        self.actReturnLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.actReturnLabel.setObjectName("actReturnLabel")
        self.actReturnLayout.addWidget(self.actReturnLabel, 0, 3, 1, 1)
        self.actSelectReturnList = KeyListWidget(actionDialog)
        self.actSelectReturnList.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove)
        self.actSelectReturnList.setObjectName("actSelectReturnList")
        self.actReturnLayout.addWidget(self.actSelectReturnList, 1, 3, 1, 1)
        self.actAvailInputList = QtWidgets.QListWidget(actionDialog)
        self.actAvailInputList.setViewMode(QtWidgets.QListView.ListMode)
        self.actAvailInputList.setObjectName("actAvailInputList")
        self.actReturnLayout.addWidget(self.actAvailInputList, 2, 2, 1, 1)
        self.actSelectLabel = QtWidgets.QLabel(actionDialog)
        font = QtGui.QFont()
        font.setBold(False)
        font.setWeight(50)
        self.actSelectLabel.setFont(font)
        self.actSelectLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.actSelectLabel.setObjectName("actSelectLabel")
        self.actReturnLayout.addWidget(self.actSelectLabel, 1, 0, 1, 1)

# Path: lazylyst/CustomWidgets.py
# class HoverLineEdit(QtWidgets.QLineEdit):
#     hoverOut = QtCore.pyqtSignal()
#     
#     def __init__(self, parent=None):
#         super(HoverLineEdit, self).__init__(parent)   
#         self.changeState=False        
#         self.textChanged.connect(self.updateChangeState)
#         
#     def leaveEvent(self, ev):
#         # Only emit if the text was changed
#         if self.changeState:
#             self.hoverOut.emit()
#             self.changeState=False
#     
#     def updateChangeState(self,ev):
#         self.changeState=True
# 
# class KeyBindLineEdit(QtWidgets.QLineEdit):
#     keyPressed=QtCore.pyqtSignal(str)
#     
#     def __init__(self, parent=None):
#         super(KeyBindLineEdit, self).__init__(parent)    
#         self.MOD_MASK = (Qt.CTRL | Qt.ALT | Qt.SHIFT | Qt.META)
#     
#     # If any usual key bind was pressed, return the human recognizable string
#     def keyPressEvent(self, ev):
#         keyname = keyPressToString(ev)
#         if keyname==None:
#             return
#         self.keyPressed.emit(keyname)
# 
# class KeyListWidget(QtWidgets.QListWidget):       
#     # Return signal if key was pressed while in focus
#     keyPressedSignal = QtCore.pyqtSignal()  
#     
#     def __init__(self, parent=None):
#         super(KeyListWidget, self).__init__(parent)
#     
#     # Update this widgets last pressed key, and return a signal
#     def keyPressEvent(self, ev):
#         self.key=ev.key()
#         if self.key not in [Qt.Key_Delete]:
#             return
#         self.keyPressedSignal.emit()
#         
#     # Deselect all items if in a blank space
#     def mousePressEvent(self, ev):
#         if self.itemAt(ev.pos()) is None:
#             self.clearSelection()
#         QtWidgets.QListWidget.mousePressEvent(self, ev)
#     
#     # Ensure that key presses are sent to the widget which the mouse is hovering over
#     def enterEvent(self,ev):
#         super(KeyListWidget, self).enterEvent(ev)
#         self.setFocus()
# 
#     # Return a lists entries in the order which is appears
#     def visualListOrder(self):
#         txt=np.array([self.item(i).text() for i in range(self.count())])
#         args=np.array([self.indexFromItem(self.item(i)).row() for i in range(self.count())])
#         return list(txt[np.argsort(args)])


# Path: lazylyst/UI/ActionSetup.py
from PyQt5 import QtCore, QtGui, QtWidgets
from lazylyst.CustomWidgets import HoverLineEdit, KeyBindLineEdit, KeyListWidget

        font.setBold(False)
        font.setWeight(50)
        self.actInputLabel.setFont(font)
        self.actInputLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.actInputLabel.setObjectName("actInputLabel")
        self.actReturnLayout.addWidget(self.actInputLabel, 0, 2, 1, 1)
        self.actReturnLabel = QtWidgets.QLabel(actionDialog)
        font = QtGui.QFont()
        font.setBold(False)
        font.setWeight(50)
        self.actReturnLabel.setFont(font)
        self.actReturnLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.actReturnLabel.setObjectName("actReturnLabel")
        self.actReturnLayout.addWidget(self.actReturnLabel, 0, 3, 1, 1)
        self.actSelectReturnList = KeyListWidget(actionDialog)
        self.actSelectReturnList.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove)
        self.actSelectReturnList.setObjectName("actSelectReturnList")
        self.actReturnLayout.addWidget(self.actSelectReturnList, 1, 3, 1, 1)
        self.actAvailInputList = QtWidgets.QListWidget(actionDialog)
        self.actAvailInputList.setViewMode(QtWidgets.QListView.ListMode)
        self.actAvailInputList.setObjectName("actAvailInputList")
        self.actReturnLayout.addWidget(self.actAvailInputList, 2, 2, 1, 1)
        self.actSelectLabel = QtWidgets.QLabel(actionDialog)
        font = QtGui.QFont()
        font.setBold(False)
        font.setWeight(50)
        self.actSelectLabel.setFont(font)
        self.actSelectLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.actSelectLabel.setObjectName("actSelectLabel")
        self.actReturnLayout.addWidget(self.actSelectLabel, 1, 0, 1, 1)

        self.actSelectTriggerList = KeyListWidget(actionDialog)