Skip to content

Commit

Permalink
schemeedit: Add mouse back/forward button navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Dec 8, 2021
1 parent 010d2b2 commit 67aa297
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions orangecanvas/document/schemeedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,14 @@ def eventFilter(self, obj, event):
elif etype == QEvent.GraphicsSceneDrop:
return self.sceneDropEvent(event)
elif etype == QEvent.GraphicsSceneMousePress:
self.__pasteOrigin = event.scenePos()
if event.button() == Qt.BackButton:
self.__historyStep(-1)
elif event.button() == Qt.ForwardButton:
self.__historyStep(1)
elif event.button() in (
Qt.LeftButton, Qt.RightButton, Qt.MiddleButton
):
self.__pasteOrigin = event.scenePos()
return self.sceneMousePressEvent(event)
elif etype == QEvent.GraphicsSceneMouseMove:
return self.sceneMouseMoveEvent(event)
Expand Down Expand Up @@ -1733,8 +1740,8 @@ def sceneMouseDoubleClickEvent(self, event):
return False

item = scene.item_at(event.scenePos())
if not item and self.__quickMenuTriggers & \
SchemeEditWidget.DoubleClicked:
if not item and event.button() == Qt.LeftButton and \
self.__quickMenuTriggers & SchemeEditWidget.DoubleClicked:
# Double click on an empty spot
# Create a new node using QuickMenu
action = interactions.NewNodeAction(self)
Expand Down

0 comments on commit 67aa297

Please sign in to comment.