Mini Editor eric7

Sat, 23 Oct 2021 09:16:10 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 23 Oct 2021 09:16:10 +0200
branch
eric7
changeset 8712
ce5d777ecfef
parent 8711
440cd184f14c
child 8713
c2a124c2ecbb

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

eric7/QScintilla/MiniEditor.py file | annotate | diff | comparison | revisions
--- 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