From e037c2d4256e2975e50d00517526794dff444f0d Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Sat, 12 May 2012 18:49:08 -0500 Subject: Fixed up some formatting, made the animation panel into a dock widget, added a delay value to doodad animations and implemented it editor-side --- src/editorui/doodads.py | 10 ++-------- src/editorui/editormain.py | 8 +++++++- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/editorui') diff --git a/src/editorui/doodads.py b/src/editorui/doodads.py index 07eca43..6bb4576 100644 --- a/src/editorui/doodads.py +++ b/src/editorui/doodads.py @@ -365,8 +365,8 @@ class KPEditorDoodad(KPEditorItem): self._updateSize() self._updateTransform() - self.anmButton = self.DoodadAnmButton(self._doodadRef) - self.anmProxy = self.HiddenProxy(self.anmButton, self, self.boundingRect().right() - 101, self.boundingRect().bottom() - 25) + # self.anmButton = self.DoodadAnmButton(self._doodadRef) + # self.anmProxy = self.HiddenProxy(self.anmButton, self, self.boundingRect().right() - 101, self.boundingRect().bottom() - 25) self.setAcceptHoverEvents(True) @@ -377,7 +377,6 @@ class KPEditorDoodad(KPEditorItem): KPEditorDoodad.SELECTION_PEN = QtGui.QPen(Qt.red, 1, Qt.DotLine) - def _updatePixmap(self): pixmap = self.source[1] @@ -418,11 +417,6 @@ class KPEditorDoodad(KPEditorItem): if self.isSelected(): painter.setPen(self.SELECTION_PEN) painter.drawRect(self._selectionRect) - - self.anmProxy.show() - - else: - self.anmProxy.hide() def _itemMoved(self, oldX, oldY, newX, newY): diff --git a/src/editorui/editormain.py b/src/editorui/editormain.py index 1cd2948..263c547 100644 --- a/src/editorui/editormain.py +++ b/src/editorui/editormain.py @@ -703,8 +703,8 @@ class KPEditorWidget(QtGui.QGraphicsView): else: QtGui.QGraphicsView.mousePressEvent(self, event) - + def mouseMoveEvent(self, event): if event.buttons() == Qt.RightButton and self.painting: self._movedWhilePainting(event) @@ -714,6 +714,11 @@ class KPEditorWidget(QtGui.QGraphicsView): QtGui.QGraphicsView.mouseMoveEvent(self, event) + def mouseReleaseEvent(self, event): + QtGui.QGraphicsView.mouseReleaseEvent(self, event) + self.userClick.emit() + + def keyPressEvent(self, event): if event.key() == QtCore.Qt.Key_Delete or event.key() == QtCore.Qt.Key_Backspace: scene = self.scene() @@ -730,6 +735,7 @@ class KPEditorWidget(QtGui.QGraphicsView): else: QtGui.QGraphicsView.keyPressEvent(self, event) + userClick = QtCore.pyqtSignal() -- cgit v1.2.3