Sat, 23 Oct 2021 09:16:10 +0200
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.