diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 2177a67de..4117d9f03 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -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."), diff --git a/qutebrowser/widgets/tabwidget.py b/qutebrowser/widgets/tabwidget.py index c642cbd50..6738665d2 100644 --- a/qutebrowser/widgets/tabwidget.py +++ b/qutebrowser/widgets/tabwidget.py @@ -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())