From 694efee08e28a9cfc59e79f6a4711fd6e369af7e Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 17 Dec 2009 09:37:25 +0000 Subject: [PATCH] =?UTF-8?q?fullScreenCanvas=E5=BB=83=E6=AD=A2=EF=BC=88?= =?UTF-8?q?=E3=80=8C=E8=87=AA=E5=8B=95=E3=81=A7=E9=9A=A0=E3=81=99=E3=80=8D?= =?UTF-8?q?=E3=81=8C=E3=82=88=E3=82=8A=E9=AB=98=E9=80=9F=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=9F=EF=BC=89?= 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@5532 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/res/fullScreenCanvas.xul | 374 ------------------ content/treestyletab/treestyletab.xul | 1 - .../treestyletabbrowser_autoHide.js | 78 ++-- defaults/preferences/treestyletab.js | 1 - 4 files changed, 46 insertions(+), 408 deletions(-) delete mode 100644 content/treestyletab/res/fullScreenCanvas.xul diff --git a/content/treestyletab/res/fullScreenCanvas.xul b/content/treestyletab/res/fullScreenCanvas.xul deleted file mode 100644 index fdd3d96d..00000000 --- a/content/treestyletab/res/fullScreenCanvas.xul +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - - - - - diff --git a/content/treestyletab/treestyletab.xul b/content/treestyletab/treestyletab.xul index f8ccd414..fbf86d5c 100644 --- a/content/treestyletab/treestyletab.xul +++ b/content/treestyletab/treestyletab.xul @@ -3,7 +3,6 @@ - diff --git a/content/treestyletab/treestyletabbrowser_autoHide.js b/content/treestyletab/treestyletabbrowser_autoHide.js index a41eb273..f05a9c85 100644 --- a/content/treestyletab/treestyletabbrowser_autoHide.js +++ b/content/treestyletab/treestyletabbrowser_autoHide.js @@ -416,44 +416,51 @@ TreeStyleTabBrowserAutoHide.prototype = { showHideInternal : function(aReason) { - var doShowHide = function() { - var sv = this.mOwner; - var b = sv.mTabBrowser; - var pos = b.getAttribute(sv.kTABBAR_POSITION); + var viewer = this.getViewerForFrame(window); + viewer.hide(); - if (this.shown) { // to be hidden or shrunken - this.onHiding(); - this.showHideReason = aReason || this.kSHOWN_BY_UNKNOWN; - this.shown = false; - } - else { // to be shown or expanded - this.onShowing(); - this.showHideReason = aReason || this.kSHOWN_BY_UNKNOWN; - this.shown = true; - } + var sv = this.mOwner; + var b = sv.mTabBrowser; + var pos = b.getAttribute(sv.kTABBAR_POSITION); - this.fireStateChangingEvent(); + if (this.shown) { // to be hidden or shrunken + this.onHiding(); + this.showHideReason = aReason || this.kSHOWN_BY_UNKNOWN; + this.shown = false; + } + else { // to be shown or expanded + this.onShowing(); + this.showHideReason = aReason || this.kSHOWN_BY_UNKNOWN; + this.shown = true; + } - window.setTimeout(function(aSelf) { - if (aSelf.shown) { - sv.mTabBrowser.setAttribute(aSelf.kAUTOHIDE, 'show'); - aSelf.redrawContentArea(); - } - b.mTabContainer.adjustTabstrip(); - sv.checkTabsIndentOverflow(); + this.fireStateChangingEvent(); + + window.setTimeout(function(aSelf) { + if (aSelf.shown) { + sv.mTabBrowser.setAttribute(aSelf.kAUTOHIDE, 'show'); aSelf.redrawContentArea(); - fullScreenCanvas.hide(); + } + b.mTabContainer.adjustTabstrip(); + sv.checkTabsIndentOverflow(); + aSelf.redrawContentArea(); - aSelf.fireStateChangeEvent(); - }, 0, this); - }; + aSelf.fireStateChangeEvent(); - if (this.getTreePref('tabbar.autoHide.useFullScreenCanvas')) - fullScreenCanvas.show(document.getElementById('appcontent'), doShowHide, this); - else - doShowHide.call(this); + viewer.show(); + }, 0, this); }, + getViewerForFrame : function(aFrame) + { + return aFrame + .QueryInterface(Components.interfaces.nsIInterfaceRequestor) + .getInterface(Components.interfaces.nsIWebNavigation) + .QueryInterface(Components.interfaces.nsIDocShell) + .contentViewer + .QueryInterface(Components.interfaces.nsIMarkupDocumentViewer); + }, + show : function(aReason) { if (!this.shown) @@ -585,7 +592,7 @@ TreeStyleTabBrowserAutoHide.prototype = { } }, - get shouldRedraw() + get shouldRedraw() { return this.enabled && this.shown; // && this.mTabBrowser.hasAttribute(this.kTRANSPARENT); }, @@ -603,7 +610,7 @@ TreeStyleTabBrowserAutoHide.prototype = { var browserBox = sv.mTabBrowser.mCurrentBrowser.boxObject; var contentBox = sv.getBoxObjectFor(frame.document.documentElement); - var zoom = fullScreenCanvas.getZoomForFrame(frame); + var zoom = this.getZoomForFrame(frame); var x = (pos == 'right') ? browserBox.width - this.XOffset : 0 ; var y = (pos == 'bottom') ? browserBox.height - this.YOffset : 0 ; @@ -718,6 +725,13 @@ TreeStyleTabBrowserAutoHide.prototype = { parseInt(parseInt(RegExp.$3) * 0.8) ].join(',')+')'; }, + + getZoomForFrame : function(aFrame) + { + var zoom = this.getViewerForFrame(aFrame) + .fullZoom; + return (zoom * 1000 % 1) ? zoom+0.025 : zoom ; + }, clearBG : function() { diff --git a/defaults/preferences/treestyletab.js b/defaults/preferences/treestyletab.js index 99e96ad5..1d5da14c 100644 --- a/defaults/preferences/treestyletab.js +++ b/defaults/preferences/treestyletab.js @@ -24,7 +24,6 @@ pref("extensions.treestyletab.tabbar.autoHide.mode.fullscreen", 1); pref("extensions.treestyletab.tabbar.autoHide.delay", 50); pref("extensions.treestyletab.tabbar.autoHide.area", 7); pref("extensions.treestyletab.tabbar.autoHide.expandArea", false); -pref("extensions.treestyletab.tabbar.autoHide.useFullScreenCanvas", true); // 0 = not transparent, 1 = partial transparent, 2 = completely transparent pref("extensions.treestyletab.tabbar.transparent.style", 1); pref("extensions.treestyletab.tabbar.transparent.partialTransparency", "0.25");