diff options
| author | tassaron | 2017-08-09 16:46:59 -0400 |
|---|---|---|
| committer | tassaron | 2017-08-09 16:46:59 -0400 |
| commit | 8b253717f7c0dd3fe73b1f3474fea2176e8f19ba (patch) | |
| tree | 73ea6a8c9f253311ee79fb75d17637ccc2670c27 /src/mainwindow.py | |
| parent | 3ed84e1c3edba46fe8990544ef7e58fe8e3dd901 (diff) | |
Conway's Game of Life component
Diffstat (limited to 'src/mainwindow.py')
| -rw-r--r-- | src/mainwindow.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mainwindow.py b/src/mainwindow.py index 1c8806d..789a6e7 100644 --- a/src/mainwindow.py +++ b/src/mainwindow.py @@ -50,6 +50,22 @@ class PreviewWindow(QtWidgets.QLabel): self.pixmap = QtGui.QPixmap(img) self.repaint() + def mousePressEvent(self, event): + if self.parent.encoding: + return + + i = self.parent.window.listWidget_componentList.currentRow() + if i >= 0: + component = self.parent.core.selectedComponents[i] + if not hasattr(component, 'previewClickEvent'): + return + pos = (event.x(), event.y()) + size = (self.width(), self.height()) + component.previewClickEvent( + pos, size, event.button() + ) + self.parent.core.updateComponent(i) + @QtCore.pyqtSlot(str) def threadError(self, msg): self.parent.showMessage( |
