From 84b3e71d7e0bc9e89a69ce136b79cebabd3a0d1b Mon Sep 17 00:00:00 2001 From: piro Date: Sun, 21 Oct 2007 17:45:14 +0000 Subject: [PATCH] =?UTF-8?q?AutoHide=E3=81=A8=E3=81=AE=E9=80=A3=E6=90=BA?= =?UTF-8?q?=E3=82=92=E5=BC=B7=E5=8C=96?= 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@1269 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.css | 9 ++- content/treestyletab/treestyletab.js | 99 +++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/content/treestyletab/treestyletab.css b/content/treestyletab/treestyletab.css index 316fc025..57e174e3 100644 --- a/content/treestyletab/treestyletab.css +++ b/content/treestyletab/treestyletab.css @@ -16,7 +16,8 @@ tab[treestyletab-drop-position] .treestyletab-drop-marker { } tab[treestyletab-collapsed="true"], -.tabbrowser-strip[collapsed="true"]+splitter { +.tabbrowser-strip[collapsed="true"]+splitter, +#appcontent[ahFull="true"] .tabbrowser-strip[ahHIDE="true"]+splitter /* AutoHide */ { visibility: collapse; } @@ -29,6 +30,12 @@ tabbrowser[treestyletab-vertical="true"] .tab-drop-indicator-bar display: none !important; } +/* to modify browser's margin-left/margin-right dynamically */ +#appcontent { + position: relative; + margin: 0; +} + tabbrowser[treestyletab-vertical="true"] > tabbox { -moz-box-orient: horizontal !important; } diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 06b69d3a..3a3ddf54 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -823,6 +823,105 @@ catch(e) { } if ('autoHIDE' in window) { + eval('autoHIDE.ShowMenu = '+ + autoHIDE.ShowMenu.toSource().replace( + '{', + '{ var treeStyleTabPos = TreeStyleTabService.getPref("extensions.treestyletab.tabbar.position");' + ).replace( + 'e.screenY <= autoHIDE.Win.boxObject.screenY + autoHIDE.space', + <>= autoHIDE.Win.boxObject.screenX + autoHIDE.Win.boxObject.width - autoHIDE.space) : + treeStyleTabPos == 'bottom' ? + (e.screenY >= autoHIDE.Win.boxObject.screenY + autoHIDE.Win.boxObject.height - autoHIDE.space) : + false + ))]]> + ).replace( + 'e.screenY > getBrowser().mCurrentBrowser.boxObject.screenY + 25', + <> getBrowser().mCurrentBrowser.boxObject.screenY + 25 && + ( + treeStyleTabPos == 'left' ? + (e.screenX > getBrowser().mCurrentBrowser.boxObject.screenX + 25) : + treeStyleTabPos == 'right' ? + (e.screenX < getBrowser().mCurrentBrowser.boxObject.screenX + getBrowser().mCurrentBrowser.boxObject.width - 25) : + treeStyleTabPos == 'bottom' ? + (e.screenY < getBrowser().mCurrentBrowser.boxObject.screenY + getBrowser().mCurrentBrowser.boxObject.height - 25) : + true + ))]]> + ) + ); + eval('autoHIDE.HideToolbar = '+ + autoHIDE.HideToolbar.toSource().replace( + 'if (this.Show) {', + <> + ) + ); + eval('autoHIDE.EndFull = '+ + autoHIDE.EndFull.toSource().replace( + '{', + <> + ) + ); + eval('autoHIDE.SetMenu = '+ + autoHIDE.SetMenu.toSource().replace( + '{', + <> + ) + ); + eval('autoHIDE.MoveC = '+ + autoHIDE.MoveC.toSource().replace( + '{', + <> + ).replace( + '.move(0, - this.delta)', + '.move((treeStyleTabPos == "left" ? -this.__treestyletab__tabBarWidth : 0 ), -this.delta)' + ) + ); } },