[pyzo] 36/68: Allow closing tabs with middle button
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Sep 28 09:47:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/master
in repository pyzo.
commit 4d7438a2b21767dbecda926fe24c64592d5e5d2d
Author: Almar Klein <almar.klein at gmail.com>
Date: Fri Sep 16 00:13:57 2016 +0200
Allow closing tabs with middle button
---
pyzo/core/compactTabWidget.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/pyzo/core/compactTabWidget.py b/pyzo/core/compactTabWidget.py
index f7b72b1..be5ec2d 100644
--- a/pyzo/core/compactTabWidget.py
+++ b/pyzo/core/compactTabWidget.py
@@ -209,6 +209,15 @@ class CompactTabBar(QtGui.QTabBar):
self.tabDoubleClicked.emit(i)
+ def mousePressEvent(self, event):
+ if event.button() == QtCore.Qt.MiddleButton:
+ i = self.tabAt(event.pos())
+ if i >= 0:
+ self.parent().tabCloseRequested.emit(i)
+ return
+ super().mousePressEvent(event)
+
+
def setTabData(self, i, data):
""" setTabData(i, data)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyzo.git
More information about the debian-science-commits
mailing list