Allow to specify different delay for autoshow/hide on mousemove

This commit is contained in:
YUKI Hiroshi 2016-02-22 14:03:26 +09:00
parent 55fa2764b8
commit 534c809052
2 changed files with 8 additions and 3 deletions

View File

@ -129,7 +129,8 @@ pref("extensions.treestyletab.tabbar.autoHide.contentAreaScreen.enabled", true);
* Triggers for the "Auto Hide" feature. They can be controlled via the * Triggers for the "Auto Hide" feature. They can be controlled via the
* configuration dialog. * configuration dialog.
*/ */
pref("extensions.treestyletab.tabbar.autoHide.delay", 50); pref("extensions.treestyletab.tabbar.autoHide.delay.show", 50);
pref("extensions.treestyletab.tabbar.autoHide.delay.hide", -1); // same to "show"
pref("extensions.treestyletab.tabbar.autoHide.area", 7); pref("extensions.treestyletab.tabbar.autoHide.area", 7);
pref("extensions.treestyletab.tabbar.autoShow.mousemove", true); pref("extensions.treestyletab.tabbar.autoShow.mousemove", true);
pref("extensions.treestyletab.tabbar.autoShow.accelKeyDown", true); pref("extensions.treestyletab.tabbar.autoShow.accelKeyDown", true);

View File

@ -598,6 +598,7 @@ AutoHideBrowser.prototype = inherit(AutoHideBase.prototype, {
this.showHideContentsAreaScreen(); this.showHideContentsAreaScreen();
var shouldShow = position & this.MOUSE_POSITION_SENSITIVE; var shouldShow = position & this.MOUSE_POSITION_SENSITIVE;
var delayToShow = utils.getTreePref('tabbar.autoHide.delay.show');
if (this.expanded) { // currently shown, let's hide it. if (this.expanded) { // currently shown, let's hide it.
if (shouldShow) { if (shouldShow) {
this.show(this.kSHOWN_BY_MOUSEMOVE); this.show(this.kSHOWN_BY_MOUSEMOVE);
@ -607,12 +608,15 @@ AutoHideBrowser.prototype = inherit(AutoHideBase.prototype, {
!shouldShow && !shouldShow &&
utils.getTreePref('tabbar.autoShow.mousemove') utils.getTreePref('tabbar.autoShow.mousemove')
) { ) {
let delayToHide = utils.getTreePref('tabbar.autoHide.delay.hide');
if (delayToHide < 0)
delayToHide = delayToShow;
this.showHideOnMouseMoveTimer = w.setTimeout( this.showHideOnMouseMoveTimer = w.setTimeout(
function(aSelf) { function(aSelf) {
aSelf.cancelDelayedShowForShortcut(); aSelf.cancelDelayedShowForShortcut();
aSelf.hide(aSelf.kSHOWN_BY_MOUSEMOVE); aSelf.hide(aSelf.kSHOWN_BY_MOUSEMOVE);
}, },
utils.getTreePref('tabbar.autoHide.delay'), delayToHide,
this this
); );
} }
@ -623,7 +627,7 @@ AutoHideBrowser.prototype = inherit(AutoHideBase.prototype, {
aSelf.cancelDelayedShowForShortcut(); aSelf.cancelDelayedShowForShortcut();
aSelf.show(aSelf.kSHOWN_BY_MOUSEMOVE); aSelf.show(aSelf.kSHOWN_BY_MOUSEMOVE);
}, },
utils.getTreePref('tabbar.autoHide.delay'), delayToShow,
this this
); );
} }