105 lines
3.7 KiB
Diff
105 lines
3.7 KiB
Diff
# HG changeset patch
|
|
# User Philip Chee <philip.chee@gmail.com>
|
|
# Date 1314371784 -28800
|
|
# Node ID bce6138fb07449887e0e791965f90af87c28ca98
|
|
# Parent a11ec626d4ab7088f8d9753e8fec90197e6b899b
|
|
Bug 673878 Use SHIFT+DOMMouseScroll to advance the selected tab.
|
|
This will allow plain DOMMouseScroll to scroll the tabbar without changing the selected tab.
|
|
|
|
diff --git a/suite/browser/browser-prefs.js b/suite/browser/browser-prefs.js
|
|
--- a/suite/browser/browser-prefs.js
|
|
+++ b/suite/browser/browser-prefs.js
|
|
@@ -279,16 +279,21 @@ pref("browser.tabs.tabClipWidth", 140);
|
|
|
|
// Where to show tab close buttons:
|
|
// 0 on active tab only
|
|
// 1 on all tabs until tabClipWidth is reached, then active tab only
|
|
// 2 no close buttons at all
|
|
// 3 at the end of the tabstrip
|
|
pref("browser.tabs.closeButtons", 3);
|
|
|
|
+// Mouse wheel action when over the tab bar:
|
|
+// false The mouse wheel scrolls the whole tab bar like Firefox (default).
|
|
+// true The mouse wheel advances the selected tab.
|
|
+pref("browser.tabs.mouseScrollAdvance", false);
|
|
+
|
|
// lets new tab/window load something different than first window
|
|
// -1 - use navigator startup preference
|
|
// 0 - loads blank page
|
|
// 1 - loads home page
|
|
// 2 - loads last page visited
|
|
pref("browser.tabs.loadOnNewTab", 0);
|
|
pref("browser.windows.loadOnNewWindow", 1);
|
|
|
|
diff --git a/suite/browser/tabbrowser.xml b/suite/browser/tabbrowser.xml
|
|
--- a/suite/browser/tabbrowser.xml
|
|
+++ b/suite/browser/tabbrowser.xml
|
|
@@ -2999,16 +2999,17 @@
|
|
<constructor>
|
|
<![CDATA[
|
|
var tab = this.firstChild;
|
|
// set the tabstrip's minWidth too, otherwise it immediately overflows
|
|
this.mTabstrip.style.minWidth =
|
|
tab.style.minWidth = this.mPrefs.getIntPref("browser.tabs.tabMinWidth") + "px";
|
|
tab.style.maxWidth = this.mPrefs.getIntPref("browser.tabs.tabMaxWidth") + "px";
|
|
window.addEventListener("resize", this, false);
|
|
+ this.mScrollSelectedTab = this.mPrefs.getBoolPref("browser.tabs.mouseScrollAdvance");
|
|
]]>
|
|
</constructor>
|
|
|
|
<destructor>
|
|
<![CDATA[
|
|
window.removeEventListener("resize", this, false);
|
|
]]>
|
|
</destructor>
|
|
@@ -3116,32 +3117,48 @@
|
|
* if a tab was inserted to the overflow area or removed from it
|
|
* without any scrolling and when the tabbar has already
|
|
* overflowed.
|
|
*/
|
|
this.mTabstrip._updateScrollButtonsDisabledState();
|
|
]]>
|
|
</body>
|
|
</method>
|
|
+
|
|
+ <field name="mScrollSelectedTab">
|
|
+ false
|
|
+ </field>
|
|
+
|
|
+ <method name="_handleMouseScroll">
|
|
+ <parameter name="aEvent"/>
|
|
+ <body>
|
|
+ <![CDATA[
|
|
+ // Javascript does not have a logical XOR operator.
|
|
+ if (aEvent.shiftKey != this.mScrollSelectedTab) {
|
|
+ this.advanceSelectedTab(aEvent.detail < 0 ? -1 : 1);
|
|
+ aEvent.stopPropagation();
|
|
+ }
|
|
+ ]]>
|
|
+ </body>
|
|
+ </method>
|
|
</implementation>
|
|
|
|
<handlers>
|
|
<handler event="TabSelect" action="this._handleTabSelect();"/>
|
|
|
|
<handler event="transitionend">
|
|
<![CDATA[
|
|
if (event.propertyName == "max-width")
|
|
this._handleNewTab(event.target);
|
|
]]>
|
|
</handler>
|
|
|
|
<handler event="DOMMouseScroll" phase="capturing">
|
|
<![CDATA[
|
|
- this.advanceSelectedTab(event.detail < 0 ? -1 : 1);
|
|
- event.stopPropagation();
|
|
+ this._handleMouseScroll(event);
|
|
]]>
|
|
</handler>
|
|
</handlers>
|
|
</binding>
|
|
|
|
<binding id="tabbrowser-alltabs-popup"
|
|
extends="chrome://global/content/bindings/popup.xml#popup">
|
|
<implementation implements="nsIDOMEventListener">
|