From 700c0118ea2dc0e3e8ad14166a158ef9e7589c06 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 2 Apr 2009 11:17:52 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=83=96=E3=83=90=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E8=87=AA=E5=8B=95=E9=96=8B=E9=96=89=E6=A9=9F=E8=83=BD=E3=81=AB?= =?UTF-8?q?=E3=81=A4=E3=81=84=E3=81=A6=E3=80=81=E3=83=9D=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=BF=E4=BD=8D=E7=BD=AE=E3=81=AE=E5=88=A4=E5=88=A5=E3=81=8C?= =?UTF-8?q?=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4030 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 51 +++++++-------------- 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index a37a8321..7c49c05b 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -32,6 +32,7 @@ TreeStyleTabBrowser.prototype = { invertedSizeProp : 'width', togglerSize : 0, + sensitiveArea : 7, get browser() { @@ -478,6 +479,7 @@ TreeStyleTabBrowser.prototype = { this.observe(null, 'nsPref:changed', 'extensions.treestyletab.allowSubtreeCollapseExpand'); this.observe(null, 'nsPref:changed', 'extensions.treestyletab.tabbar.fixed'); this.observe(null, 'nsPref:changed', 'extensions.treestyletab.tabbar.transparent.style'); + this.observe(null, 'nsPref:changed', 'extensions.treestyletab.tabbar.autoHide.area'); this.observe(null, 'nsPref:changed', 'extensions.treestyletab.tabbar.togglerSize'); window.setTimeout(function() { b.treeStyleTab.observe(null, 'nsPref:changed', 'extensions.treestyletab.tabbar.autoHide.mode'); @@ -1093,6 +1095,10 @@ TreeStyleTabBrowser.prototype = { this.checkTabsIndentOverflow(); break; + case 'extensions.treestyletab.tabbar.autoHide.area': + this.sensitiveArea = value; + break; + case 'extensions.treestyletab.tabbar.togglerSize': this.togglerSize = value; var toggler = document.getAnonymousElementByAttribute(b, 'class', this.kTABBAR_TOGGLER); @@ -3568,32 +3574,6 @@ TreeStyleTabBrowser.prototype = { /* auto hide */ autoHideEnabled : false, - get sensitiveArea() - { - var b = this.mTabBrowser; - var area = Math.abs(this.getTreePref('tabbar.autoHide.area')); - var pos = b.getAttribute(this.kTABBAR_POSITION); - switch (this.autoHideMode) - { - case this.kAUTOHIDE_MODE_HIDE: - if (!this.tabbarShown && - this.getTreePref('tabbar.autoHide.expandArea')) - area += (pos == 'left' || pos == 'right') ? - this.autoHideXOffset + this.splitterWidth : - this.autoHideYOffset ; - break; - - default: - case this.kAUTOHIDE_MODE_SHRINK: - if (pos == 'left' || pos == 'right') { - if (!this.tabbarExpanded) - area = b.mStrip.boxObject.width - area; - } - break; - } - return area; - }, - startAutoHide : function() { if (this.autoHideEnabled) return; @@ -3672,15 +3652,16 @@ TreeStyleTabBrowser.prototype = { this.cancelShowHideTabbarOnMousemove(); var b = this.mTabBrowser; - var pos = b.getAttribute(this.kTABBAR_POSITION); + var pos = b.getAttribute(this.kTABBAR_POSITION); + var box = b.mCurrentBrowser.boxObject; var shouldKeepShown = ( pos == 'left' ? - (aEvent.screenX <= b.mCurrentBrowser.boxObject.screenX + this.sensitiveArea) : + (aEvent.screenX <= box.screenX + this.sensitiveArea) : pos == 'right' ? - (aEvent.screenX >= b.mCurrentBrowser.boxObject.screenX + b.boxObject.width - this.sensitiveArea) : + (aEvent.screenX >= box.screenX + box.width - this.sensitiveArea) : pos == 'bottom' ? - (aEvent.screenY >= b.mCurrentBrowser.boxObject.screenY + b.boxObject.height - this.sensitiveArea) : - (aEvent.screenY <= b.mCurrentBrowser.boxObject.screenY + this.sensitiveArea) + (aEvent.screenY >= box.screenY + box.height - this.sensitiveArea) : + (aEvent.screenY <= box.screenY + this.sensitiveArea) ); if (this.autoHideShown) { if ( @@ -3709,12 +3690,12 @@ TreeStyleTabBrowser.prototype = { } else if ( pos == 'left' ? - (aEvent.screenX <= b.boxObject.screenX + this.sensitiveArea) : + (aEvent.screenX <= box.screenX + this.sensitiveArea) : pos == 'right' ? - (aEvent.screenX >= b.boxObject.screenX + b.boxObject.width - this.sensitiveArea) : + (aEvent.screenX >= box.screenX + box.width - this.sensitiveArea) : pos == 'bottom' ? - (aEvent.screenY >= b.boxObject.screenY + b.boxObject.height - this.sensitiveArea) : - (aEvent.screenY <= b.boxObject.screenY + this.sensitiveArea) + (aEvent.screenY >= box.screenY + box.height - this.sensitiveArea) : + (aEvent.screenY <= box.screenY + this.sensitiveArea) ) { this.showHideTabbarOnMousemoveTimer = window.setTimeout( function(aSelf) {