Editor eric7

Fri, 22 Oct 2021 18:07:24 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 22 Oct 2021 18:07:24 +0200
branch
eric7
changeset 8710
d34014eaa7db
parent 8709
41a9ecc5b17b
child 8711
440cd184f14c

Editor
- added mouse button capability to perform undo/redo actions (Extra Buttons 1 and 2)

eric7/QScintilla/Editor.py file | annotate | diff | comparison | revisions
--- a/eric7/QScintilla/Editor.py	Thu Oct 21 17:59:03 2021 +0200
+++ b/eric7/QScintilla/Editor.py	Fri Oct 22 18:07:24 2021 +0200
@@ -7188,8 +7188,15 @@
         @param event the mouse press event
         @type QMouseEvent
         """
-        self.vm.eventFilter(self, event)
-        super().mousePressEvent(event)
+        if event.button() == Qt.MouseButton.XButton1:
+            self.undo()
+            event.accept()
+        elif event.button() == Qt.MouseButton.XButton2:
+            self.redo()
+            event.accept()
+        else:
+            self.vm.eventFilter(self, event)
+            super().mousePressEvent(event)
     
     def mouseDoubleClickEvent(self, evt):
         """

eric ide

mercurial