API名変更

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@7165 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-09-09 10:03:03 +00:00
parent 0988ed216a
commit 5c58302c7b
3 changed files with 23 additions and 12 deletions

View File

@ -145,11 +145,14 @@ TreeStyleTabBrowser.prototype = {
return false;
},
positionVerticalPinnedTabs : function TSTBrowser_positionVerticalPinnedTabs(aWidth, aHeight)
positionPinnedTabs : function TSTBrowser_positionPinnedTabs(aWidth, aHeight)
{
if (!this.isVertical)
return;
var b = this.mTabBrowser;
var tabbar = b.tabContainer;
var count = b._numPinnedTabs;
var count = this.pinnedTabsCount;
var width = aWidth || this.PINNED_TAB_DEFAULT_WIDTH;
var height = aHeight || this.PINNED_TAB_DEFAULT_HEIGHT;
var maxCol = Math.floor(tabbar.boxObject.width / width);
@ -164,6 +167,7 @@ TreeStyleTabBrowser.prototype = {
style.MozMarginStart = '';
style.setProperty('margin-left', (width * col)+'px', 'important');
style.setProperty('margin-top', (- height * (maxRow - row))+'px', 'important');
style.top = style.right = style.bottom = style.left = '';
col++;
if (col >= maxCol) {
col = 0;
@ -174,18 +178,15 @@ TreeStyleTabBrowser.prototype = {
PINNED_TAB_DEFAULT_WIDTH : 24,
PINNED_TAB_DEFAULT_HEIGHT : 24,
clearPinnedTabsAppearance : function TSTBrowser_clearPinnedTabsAppearance()
resetPinnedTabs : function TSTBrowser_resetPinnedTabs()
{
var b = this.mTabBrowser;
var tabbar = b.tabContainer;
tabbar.style.MozMarginStart = '';
tabbar.style.marginTop = '';
for (var i = 0, count = b._numPinnedTabs; i < count; i++)
tabbar.style.MozMarginStart = tabbar.style.marginTop = '';
for (var i = 0, count = this.pinnedTabsCount; i < count; i++)
{
let style = tabbar.childNodes[i].style;
style.MozMarginStart = '';
style.marginLeft = '';
style.marginTop = '';
style.MozMarginStart = style.marginLeft = style.marginTop = '';
}
},
@ -451,10 +452,10 @@ TreeStyleTabBrowser.prototype = {
'{',
<![CDATA[{
if (this.tabbrowser.treeStyleTab.isVertical) {
this.tabbrowser.treeStyleTab.positionVerticalPinnedTabs();
this.tabbrowser.treeStyleTab.positionPinnedTabs();
}
else {
this.tabbrowser.treeStyleTab.clearPinnedTabsAppearance();
this.tabbrowser.treeStyleTab.resetPinnedTabs();
]]>.toString()
).replace(
'this.mTabstrip.ensureElementIsVisible',

View File

@ -5,7 +5,7 @@
<RDF:Description RDF:about="urn:mozilla:install-manifest"
em:id="treestyletab@piro.sakura.ne.jp"
em:name="Tree Style Tab"
em:version="0.10.2010080802"
em:version="0.10.2010080802+"
em:creator="SHIMODA Hiroshi"
em:description="Show tabs like a tree."
em:homepageURL="http://piro.sakura.ne.jp/xul/_treestyletab.html.en"

View File

@ -1733,6 +1733,16 @@ var TreeStyleTabUtils = {
aTab.linkedBrowser.currentURI.spec.indexOf('about:treestyletab-group') > -1
);
},
get pinnedTabsCount()
{
return this.evaluateXPath(
'count(child::xul:tab[@pinned="true"])',
this.browser.mTabContainer,
Ci.nsIDOMXPathResult.NUMBER_TYPE
).numberValue;
},
/* tabbar position */