Make tab close on right click configurable
This commit is contained in:
parent
1268f7de80
commit
70f224ba32
@ -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."),
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user