eric7/QScintilla/MiniEditor.py

branch
eric7
changeset 8712
ce5d777ecfef
parent 8701
9a7ef33a4534
child 8713
c2a124c2ecbb
--- a/eric7/QScintilla/MiniEditor.py	Fri Oct 22 18:07:42 2021 +0200
+++ b/eric7/QScintilla/MiniEditor.py	Sat Oct 23 09:16:10 2021 +0200
@@ -139,6 +139,22 @@
         else:
             ev.ignore()
     
+    def mousePressEvent(self, event):
+        """
+        Protected method to handle the mouse press event.
+        
+        @param event the mouse press event
+        @type QMouseEvent
+        """
+        if event.button() == Qt.MouseButton.XButton1:
+            self.undo()
+            event.accept()
+        elif event.button() == Qt.MouseButton.XButton2:
+            self.redo()
+            event.accept()
+        else:
+            super().mousePressEvent(event)
+    
     def focusInEvent(self, event):
         """
         Protected method called when the editor receives focus.

eric ide

mercurial