piroor/treestyletab — Issue #251: [Feature patch] Scroll to change tab (better than the 'Tab Wheel Scroll' extension)
Author: timon37
Created: 2012-02-20 14:27:01+00:00
State: open

Hi I need scroll on the tab-tree to change the tab, but I find it very useful if scrolling on the scrollbar just scrolls the tree without changing the tab, and this is where 'Tab Wheel Scroll' fails me.
The reason why this is very useful is that the scrollbar is on the left edge of the screen so I can hit it easily without looking and the tab-tree is quite large so I can also hit it easily with or without looking.

To do this I just added the code below to handleEvent in browser.js:
case 'DOMMouseScroll':
var tab = this.getTabFromEvent(aEvent);
if (tab || !this.isEventFiredOnClickable(aEvent)) {
if (aEvent.detail >= 0) {
this.mTabBrowser.selectedTab = this.getNextTab(this.mTabBrowser.selectedTab);
}else {
this.mTabBrowser.selectedTab = this.getPreviousTab(this.mTabBrowser.selectedTab);
}
aEvent.stopPropagation();
}
return;
Though you'll probably want to make a method for it. Checking for the tab is necessary because you can accidentally hover above the close button which causes bad behavior.

Of course you also need the line below in _startListenTabbarEvents in browser.js:
tabContainer.addEventListener('DOMMouseScroll', this, true);