diff --git a/zxlive/graphview.py b/zxlive/graphview.py index 3ceb7dd..998c3fd 100644 --- a/zxlive/graphview.py +++ b/zxlive/graphview.py @@ -133,6 +133,8 @@ def mousePressEvent(self, e: QMouseEvent) -> None: self.wand_path.show() if self.sparkle_mode: self.sparkles.emit_sparkles(pos, 10) + else: + e.ignore() else: e.ignore() @@ -165,7 +167,8 @@ def mouseMoveEvent(self, e: QMouseEvent) -> None: if item not in self.wand_trace.hit: self.wand_trace.hit[item] = [] self.wand_trace.hit[item].append(ipos) - + else: + e.ignore() else: e.ignore() @@ -200,6 +203,8 @@ def mouseReleaseEvent(self, e: QMouseEvent) -> None: self.wand_path = None self.wand_trace_finished.emit(self.wand_trace) self.wand_trace = None + else: + e.ignore() else: e.ignore() @@ -364,6 +369,7 @@ def emit_sparkles(self, pos: QPointF, mult: int) -> None: def timerEvent(self, event: QTimerEvent) -> None: if event.timerId() != self.timer_id: + event.ignore() return for sparkle in self.sparkles: sparkle.timer_step() diff --git a/zxlive/mainwindow.py b/zxlive/mainwindow.py index 1f99eb9..d100a62 100644 --- a/zxlive/mainwindow.py +++ b/zxlive/mainwindow.py @@ -243,12 +243,16 @@ def closeEvent(self, e: QCloseEvent) -> None: self.settings.setValue("main_window_geometry", self.saveGeometry()) e.accept() - def undo(self,e: QEvent) -> None: - if self.active_panel is None: return + def undo(self, e: QEvent) -> None: + if self.active_panel is None: + e.ignore() + return self.active_panel.undo_stack.undo() - def redo(self,e: QEvent) -> None: - if self.active_panel is None: return + def redo(self, e: QEvent) -> None: + if self.active_panel is None: + e.ignore() + return self.active_panel.undo_stack.redo() def update_tab_name(self, clean:bool) -> None: diff --git a/zxlive/vitem.py b/zxlive/vitem.py index 68f71f8..593de31 100644 --- a/zxlive/vitem.py +++ b/zxlive/vitem.py @@ -260,6 +260,7 @@ def itemChange(self, change: QGraphicsItem.GraphicsItemChange, value: Any) -> An def mouseDoubleClickEvent(self, e: QGraphicsSceneMouseEvent) -> None: super().mouseDoubleClickEvent(e) if self.is_animated: + e.ignore() return scene = self.scene() if TYPE_CHECKING: assert isinstance(scene, GraphScene) @@ -268,12 +269,14 @@ def mouseDoubleClickEvent(self, e: QGraphicsSceneMouseEvent) -> None: def mousePressEvent(self, e: QGraphicsSceneMouseEvent) -> None: super().mousePressEvent(e) if self.is_animated: + e.ignore() return self._old_pos = self.pos() def mouseMoveEvent(self, e: QGraphicsSceneMouseEvent) -> None: super().mouseMoveEvent(e) if self.is_animated: + e.ignore() return scene = self.scene() if TYPE_CHECKING: assert isinstance(scene, GraphScene) @@ -287,6 +290,7 @@ def mouseMoveEvent(self, e: QGraphicsSceneMouseEvent) -> None: elif self.is_dragging and self.ty == VertexType.W_INPUT: w_out = get_w_partner_vitem(self) if w_out is None: + e.ignore() return w_out.set_vitem_rotation() if self.is_dragging and len(scene.selectedItems()) == 1: @@ -316,6 +320,7 @@ def mouseReleaseEvent(self, e: QGraphicsSceneMouseEvent) -> None: # manually detect mouse releases. super().mouseReleaseEvent(e) if self.is_animated: + e.ignore() return if e.button() == Qt.MouseButton.LeftButton: if self._old_pos != self.pos(): @@ -343,6 +348,8 @@ def mouseReleaseEvent(self, e: QGraphicsSceneMouseEvent) -> None: scene.vertices_moved.emit([(it.v, *pos_from_view(it.pos().x(), it.pos().y())) for it in moved_vertices]) self._dragged_on = None self._old_pos = None + else: + e.ignore() else: e.ignore()