parent
a345b02729
commit
45dea54e3c
@ -111,6 +111,7 @@
|
||||
|<<tabs-indicator-space,indicator-space>>|Spacing between tab edge and indicator.
|
||||
|<<tabs-tabs-are-windows,tabs-are-windows>>|Whether to open windows instead of tabs.
|
||||
|<<tabs-title-format,title-format>>|The format to use for the tab title. The following placeholders are defined:
|
||||
|<<tabs-mousewheel-tab-switching,mousewheel-tab-switching>>|Switch between tabs using the mouse wheel.
|
||||
|==============
|
||||
|
||||
.Quick reference for section ``storage''
|
||||
@ -1031,6 +1032,17 @@ The format to use for the tab title. The following placeholders are defined:
|
||||
|
||||
Default: +pass:[{index}: {title}]+
|
||||
|
||||
[[tabs-mousewheel-tab-switching]]
|
||||
=== mousewheel-tab-switching
|
||||
Switch between tabs using the mouse wheel.
|
||||
|
||||
Valid values:
|
||||
|
||||
* +true+
|
||||
* +false+
|
||||
|
||||
Default: +pass:[true]+
|
||||
|
||||
== storage
|
||||
Settings related to cache and storage.
|
||||
|
||||
|
@ -522,6 +522,10 @@ def data(readonly=False):
|
||||
"* `{index}`: The index of this tab.\n"
|
||||
"* `{id}`: The internal tab ID of this tab."),
|
||||
|
||||
('mousewheel-tab-switching',
|
||||
SettingValue(typ.Bool(), 'true'),
|
||||
"Switch between tabs using the mouse wheel."),
|
||||
|
||||
readonly=readonly
|
||||
)),
|
||||
|
||||
|
@ -480,6 +480,17 @@ class TabBar(QTabBar):
|
||||
new_idx = super().insertTab(idx, icon, '')
|
||||
self.set_page_title(new_idx, text)
|
||||
|
||||
def wheelEvent(self, event):
|
||||
"""Override wheelEvent to make the action configurable."""
|
||||
if config.get('tabs', 'mousewheel-tab-switching'):
|
||||
super().wheelEvent(event)
|
||||
else:
|
||||
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
||||
window=self._win_id)
|
||||
focused_tab = tabbed_browser.currentWidget()
|
||||
if focused_tab is not None:
|
||||
focused_tab.wheelEvent(event)
|
||||
|
||||
|
||||
class TabBarStyle(QCommonStyle):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user