diff options
author | Naleo <naleo@naleo.me> | 2021-07-02 15:04:59 -1000 |
---|---|---|
committer | Naleo <naleo@naleo.me> | 2021-07-02 15:04:59 -1000 |
commit | 6094f003bf9acb9a33b84cae741c0855c2ad967a (patch) | |
tree | 0df0d7201dae7bd2362e42677cdb6020a789493f /qutebrowser | |
parent | 4c479bb4ab9a25276ea9045c99b690dc925dd345 (diff) | |
download | qutebrowser-6094f003bf9acb9a33b84cae741c0855c2ad967a.tar.gz qutebrowser-6094f003bf9acb9a33b84cae741c0855c2ad967a.zip |
fix mac scrolling through tabbar (issue #6148)
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/mainwindow/tabwidget.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index 4041de2c9..0d8c39f9a 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -705,7 +705,17 @@ class TabBar(QTabBar): e: The QWheelEvent """ if config.val.tabs.mousewheel_switching: - super().wheelEvent(e) + if utils.is_mac: + index = self.currentIndex() + if index != -1: + if e.angleDelta().y() > 0: + index += -1 + else: + index += 1 + if index >= 0 and index < self.count(): + self.setCurrentIndex(index) + else: + super().wheelEvent(e) else: tabbed_browser = objreg.get('tabbed-browser', scope='window', window=self._win_id) |