Make tab close on right click configurable

This commit is contained in:
Florian Bruhin 2014-06-23 15:47:31 +02:00
parent 1268f7de80
commit 70f224ba32
2 changed files with 6 additions and 1 deletions

View File

@ -401,6 +401,10 @@ DATA = OrderedDict([
SettingValue(types.Bool(), 'true'),
"Whether tabs should be movable."),
('close-on-right-click',
SettingValue(types.Bool(), 'false'),
"Whether tabs should close when right-clicked."),
('close-buttons',
SettingValue(types.Bool(), 'false'),
"Whether tabs should have close-buttons."),

View File

@ -128,7 +128,8 @@ class TabBar(QTabBar):
def mousePressEvent(self, e):
"""Override mousePressEvent to emit tabCloseRequested on rightclick."""
if e.button() != Qt.RightButton:
if (e.button() != Qt.RightButton or
not config.get('tabbar', 'close-on-right-click')):
super().mousePressEvent(e)
return
idx = self.tabAt(e.pos())