component list not visually disabled

this looks better on Mac
This commit is contained in:
tassaron 2017-06-25 20:43:06 -04:00
parent 4eb2bc9a41
commit 7b6ef6349b
1 changed files with 5 additions and 2 deletions

View File

@ -485,7 +485,6 @@ class MainWindow(QtWidgets.QMainWindow):
self.window.pushButton_removeComponent.setEnabled(False) self.window.pushButton_removeComponent.setEnabled(False)
self.window.pushButton_listMoveDown.setEnabled(False) self.window.pushButton_listMoveDown.setEnabled(False)
self.window.pushButton_listMoveUp.setEnabled(False) self.window.pushButton_listMoveUp.setEnabled(False)
self.window.listWidget_componentList.setEnabled(False)
self.window.menuButton_newProject.setEnabled(False) self.window.menuButton_newProject.setEnabled(False)
self.window.menuButton_openProject.setEnabled(False) self.window.menuButton_openProject.setEnabled(False)
else: else:
@ -504,7 +503,6 @@ class MainWindow(QtWidgets.QMainWindow):
self.window.pushButton_removeComponent.setEnabled(True) self.window.pushButton_removeComponent.setEnabled(True)
self.window.pushButton_listMoveDown.setEnabled(True) self.window.pushButton_listMoveDown.setEnabled(True)
self.window.pushButton_listMoveUp.setEnabled(True) self.window.pushButton_listMoveUp.setEnabled(True)
self.window.listWidget_componentList.setEnabled(True)
self.window.menuButton_newProject.setEnabled(True) self.window.menuButton_newProject.setEnabled(True)
self.window.menuButton_openProject.setEnabled(True) self.window.menuButton_openProject.setEnabled(True)
self.drawPreview(True) self.drawPreview(True)
@ -566,6 +564,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.changeComponentWidget() self.changeComponentWidget()
self.drawPreview() self.drawPreview()
@disableWhenEncoding
def moveComponent(self, change): def moveComponent(self, change):
'''Moves a component relatively from its current position''' '''Moves a component relatively from its current position'''
componentList = self.window.listWidget_componentList componentList = self.window.listWidget_componentList
@ -587,16 +586,19 @@ class MainWindow(QtWidgets.QMainWindow):
stackedWidget.setCurrentIndex(newRow) stackedWidget.setCurrentIndex(newRow)
self.drawPreview() self.drawPreview()
@disableWhenEncoding
def moveComponentTop(self): def moveComponentTop(self):
componentList = self.window.listWidget_componentList componentList = self.window.listWidget_componentList
row = -componentList.currentRow() row = -componentList.currentRow()
self.moveComponent(row) self.moveComponent(row)
@disableWhenEncoding
def moveComponentBottom(self): def moveComponentBottom(self):
componentList = self.window.listWidget_componentList componentList = self.window.listWidget_componentList
row = len(componentList)-componentList.currentRow()-1 row = len(componentList)-componentList.currentRow()-1
self.moveComponent(row) self.moveComponent(row)
@disableWhenEncoding
def dragComponent(self, event): def dragComponent(self, event):
'''Drop event for the component listwidget''' '''Drop event for the component listwidget'''
componentList = self.window.listWidget_componentList componentList = self.window.listWidget_componentList
@ -739,6 +741,7 @@ class MainWindow(QtWidgets.QMainWindow):
return True return True
return False return False
@disableWhenEncoding
def componentContextMenu(self, QPos): def componentContextMenu(self, QPos):
'''Appears when right-clicking a component in the list''' '''Appears when right-clicking a component in the list'''
componentList = self.window.listWidget_componentList componentList = self.window.listWidget_componentList