Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.3, 2.0.4, and 2.0.5

stable workbench: Implemented the ability to close a tab with the mouses middle button

Changeset 8698a3edb4cd

Parent f883746a9f0d

by Michael De Wildt

Changes to one file · Browse files at 8698a3edb4cd Showing diff from parent f883746a9f0d Diff from another changeset...

 
26
27
28
 
 
 
 
 
 
 
 
29
30
31
 
74
75
76
 
77
78
79
 
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
82
83
84
85
86
87
88
@@ -26,6 +26,14 @@
 from PyQt4.QtCore import *  from PyQt4.QtGui import *   +class ThgTabBar(QTabBar): + def mouseReleaseEvent(self, event): + + if event.button() == Qt.MidButton: + self.tabCloseRequested.emit(self.tabAt(event.pos())) + + super(QTabBar, self).mouseReleaseEvent(event) +  class Workbench(QMainWindow):   """hg repository viewer/browser application"""   finished = pyqtSignal(int) @@ -74,6 +82,7 @@
  self.setWindowIcon(qtlib.geticon('hg-log'))     self.repoTabsWidget = tw = QTabWidget() + tw.setTabBar(ThgTabBar())   tw.setDocumentMode(True)   tw.setTabsClosable(True)   tw.setMovable(True)