とりあえず縦置きっぽい表示
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6413 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
a618b58102
commit
3c047020bf
@ -1177,17 +1177,19 @@ catch(e) {
|
|||||||
onTabbarResized : function TSTService_onTabbarResized(aEvent)
|
onTabbarResized : function TSTService_onTabbarResized(aEvent)
|
||||||
{
|
{
|
||||||
var b = this.getTabBrowserFromChild(aEvent.currentTarget);
|
var b = this.getTabBrowserFromChild(aEvent.currentTarget);
|
||||||
var strip = this.getTabStrip(b)
|
var strip = this.getTabStrip(b);
|
||||||
|
var placeholder = b.treeStyleTab.placeholder;
|
||||||
|
var box = (placeholder || strip).boxObject;
|
||||||
window.setTimeout(function(aSelf) {
|
window.setTimeout(function(aSelf) {
|
||||||
if (!b.treeStyleTab.clickedOnTabbarResizerGrippy) {
|
if (!b.treeStyleTab.clickedOnTabbarResizerGrippy) {
|
||||||
if (!b.treeStyleTab.isVertical) {
|
if (!b.treeStyleTab.isVertical) {
|
||||||
aSelf.setTreePref('tabbar.height', strip.boxObject.height);
|
aSelf.setTreePref('tabbar.height', box.height);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!b.treeStyleTab.autoHide.expanded)
|
if (!b.treeStyleTab.autoHide.expanded)
|
||||||
aSelf.setTreePref('tabbar.shrunkenWidth', strip.boxObject.width);
|
aSelf.setTreePref('tabbar.shrunkenWidth', box.width);
|
||||||
else
|
else
|
||||||
aSelf.setTreePref('tabbar.width', strip.boxObject.width);
|
aSelf.setTreePref('tabbar.width', box.width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
b.treeStyleTab.clickedOnTabbarResizerGrippy = false;
|
b.treeStyleTab.clickedOnTabbarResizerGrippy = false;
|
||||||
|
@ -167,13 +167,20 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.subTreeChildrenMovingCount = 0;
|
this.subTreeChildrenMovingCount = 0;
|
||||||
this._treeViewEnabled = true;
|
this._treeViewEnabled = true;
|
||||||
|
|
||||||
let (toggler) {
|
let (toggler, placeholder) {
|
||||||
toggler = document.getAnonymousElementByAttribute(b, 'class', this.kTABBAR_TOGGLER);
|
toggler = document.getAnonymousElementByAttribute(b, 'class', this.kTABBAR_TOGGLER);
|
||||||
if (!toggler) {
|
if (!toggler) {
|
||||||
toggler = document.createElement('spacer');
|
toggler = document.createElement('spacer');
|
||||||
toggler.setAttribute('class', this.kTABBAR_TOGGLER);
|
toggler.setAttribute('class', this.kTABBAR_TOGGLER);
|
||||||
b.mTabBox.insertBefore(toggler, b.mTabBox.firstChild);
|
b.mTabBox.insertBefore(toggler, b.mTabBox.firstChild);
|
||||||
}
|
}
|
||||||
|
placeholder = document.getAnonymousElementByAttribute(b, 'class', 'tabbrowser-strip');
|
||||||
|
if (!placeholder) {
|
||||||
|
placeholder = document.createElement('spacer');
|
||||||
|
placeholder.setAttribute('class', 'tabbrowser-strip');
|
||||||
|
b.mTabBox.insertBefore(placeholder, toggler.nextSibling);
|
||||||
|
this.placeholder = placeholder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let position = this.currentTabbarPosition;
|
let position = this.currentTabbarPosition;
|
||||||
@ -869,6 +876,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
b.style.visibility = 'hidden';
|
b.style.visibility = 'hidden';
|
||||||
|
|
||||||
var strip = this.tabStrip;
|
var strip = this.tabStrip;
|
||||||
|
var placeholder = this.placeholder;
|
||||||
var splitter = this._ensureNewSplitter();
|
var splitter = this._ensureNewSplitter();
|
||||||
var toggler = document.getAnonymousElementByAttribute(b, 'class', this.kTABBAR_TOGGLER);
|
var toggler = document.getAnonymousElementByAttribute(b, 'class', this.kTABBAR_TOGGLER);
|
||||||
var indicator = b.mTabDropIndicatorBar || b.tabContainer._tabDropIndicator;
|
var indicator = b.mTabDropIndicatorBar || b.tabContainer._tabDropIndicator;
|
||||||
@ -898,6 +906,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.setTabbarAttribute(this.kRESIZING, null, b);
|
this.setTabbarAttribute(this.kRESIZING, null, b);
|
||||||
|
|
||||||
strip.removeAttribute('width');
|
strip.removeAttribute('width');
|
||||||
|
if (placeholder)
|
||||||
|
placeholder.removeAttribute('width');
|
||||||
b.mPanelContainer.removeAttribute('width');
|
b.mPanelContainer.removeAttribute('width');
|
||||||
|
|
||||||
var delayedPostProcess;
|
var delayedPostProcess;
|
||||||
@ -916,6 +926,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
b.mTabContainer.orient =
|
b.mTabContainer.orient =
|
||||||
b.mTabContainer.mTabstrip.orient =
|
b.mTabContainer.mTabstrip.orient =
|
||||||
b.mTabContainer.mTabstrip.parentNode.orient = 'vertical';
|
b.mTabContainer.mTabstrip.parentNode.orient = 'vertical';
|
||||||
|
if (placeholder)
|
||||||
|
placeholder.orient = 'vertical';
|
||||||
if (allTabsButton && allTabsButton.hasChildNodes()) {
|
if (allTabsButton && allTabsButton.hasChildNodes()) {
|
||||||
allTabsButton.firstChild.setAttribute('position', 'before_start');
|
allTabsButton.firstChild.setAttribute('position', 'before_start');
|
||||||
}
|
}
|
||||||
@ -939,6 +951,10 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
|
|
||||||
strip.setAttribute('width', this.getTreePref('tabbar.width'));
|
strip.setAttribute('width', this.getTreePref('tabbar.width'));
|
||||||
strip.removeAttribute('height');
|
strip.removeAttribute('height');
|
||||||
|
if (placeholder) {
|
||||||
|
placeholder.setAttribute('width', this.getTreePref('tabbar.width'));
|
||||||
|
placeholder.removeAttribute('height');
|
||||||
|
}
|
||||||
b.mPanelContainer.removeAttribute('height');
|
b.mPanelContainer.removeAttribute('height');
|
||||||
|
|
||||||
if (pos == this.kTABBAR_RIGHT) {
|
if (pos == this.kTABBAR_RIGHT) {
|
||||||
@ -955,9 +971,14 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
/* in Firefox 3, the width of the rightside tab bar
|
/* in Firefox 3, the width of the rightside tab bar
|
||||||
unexpectedly becomes 0 on the startup. so, we have
|
unexpectedly becomes 0 on the startup. so, we have
|
||||||
to set the width again. */
|
to set the width again. */
|
||||||
strip.setAttribute('width', aSelf.getTreePref('tabbar.width'));
|
var w = aSelf.getTreePref('tabbar.width');
|
||||||
|
strip.setAttribute('width', w);
|
||||||
|
if (placeholder)
|
||||||
|
placeholder.setAttribute('width', w);
|
||||||
indicator.setAttribute('ordinal', 1);
|
indicator.setAttribute('ordinal', 1);
|
||||||
strip.setAttribute('ordinal', 30);
|
strip.setAttribute('ordinal', 30);
|
||||||
|
if (placeholder)
|
||||||
|
placeholder.setAttribute('ordinal', 30);
|
||||||
aSplitter.setAttribute('ordinal', 20);
|
aSplitter.setAttribute('ordinal', 20);
|
||||||
aToggler.setAttribute('ordinal', 40);
|
aToggler.setAttribute('ordinal', 40);
|
||||||
aTabBrowser.mPanelContainer.setAttribute('ordinal', 10);
|
aTabBrowser.mPanelContainer.setAttribute('ordinal', 10);
|
||||||
@ -971,6 +992,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
||||||
indicator.setAttribute('ordinal', 1);
|
indicator.setAttribute('ordinal', 1);
|
||||||
strip.setAttribute('ordinal', 10);
|
strip.setAttribute('ordinal', 10);
|
||||||
|
if (placeholder)
|
||||||
|
placeholder.setAttribute('ordinal', 10);
|
||||||
aSplitter.setAttribute('ordinal', 20);
|
aSplitter.setAttribute('ordinal', 20);
|
||||||
aToggler.setAttribute('ordinal', 5);
|
aToggler.setAttribute('ordinal', 5);
|
||||||
aTabBrowser.mPanelContainer.setAttribute('ordinal', 30);
|
aTabBrowser.mPanelContainer.setAttribute('ordinal', 30);
|
||||||
@ -991,6 +1014,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
b.mTabContainer.orient =
|
b.mTabContainer.orient =
|
||||||
b.mTabContainer.mTabstrip.orient =
|
b.mTabContainer.mTabstrip.orient =
|
||||||
b.mTabContainer.mTabstrip.parentNode.orient = 'horizontal';
|
b.mTabContainer.mTabstrip.parentNode.orient = 'horizontal';
|
||||||
|
if (placeholder)
|
||||||
|
placeholder.orient = 'horizontal';
|
||||||
if (allTabsButton && allTabsButton.hasChildNodes()) {
|
if (allTabsButton && allTabsButton.hasChildNodes()) {
|
||||||
allTabsButton.firstChild.setAttribute('position', 'after_end');
|
allTabsButton.firstChild.setAttribute('position', 'after_end');
|
||||||
}
|
}
|
||||||
@ -1017,6 +1042,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
||||||
indicator.setAttribute('ordinal', 1);
|
indicator.setAttribute('ordinal', 1);
|
||||||
strip.setAttribute('ordinal', 30);
|
strip.setAttribute('ordinal', 30);
|
||||||
|
if (placeholder)
|
||||||
|
placeholder.setAttribute('ordinal', 30);
|
||||||
aSplitter.setAttribute('ordinal', 20);
|
aSplitter.setAttribute('ordinal', 20);
|
||||||
aToggler.setAttribute('ordinal', 40);
|
aToggler.setAttribute('ordinal', 40);
|
||||||
aTabBrowser.mPanelContainer.setAttribute('ordinal', 10);
|
aTabBrowser.mPanelContainer.setAttribute('ordinal', 10);
|
||||||
@ -1028,6 +1055,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
||||||
indicator.setAttribute('ordinal', 1);
|
indicator.setAttribute('ordinal', 1);
|
||||||
strip.setAttribute('ordinal', 10);
|
strip.setAttribute('ordinal', 10);
|
||||||
|
if (placeholder)
|
||||||
|
placeholder.setAttribute('ordinal', 10);
|
||||||
aSplitter.setAttribute('ordinal', 20);
|
aSplitter.setAttribute('ordinal', 20);
|
||||||
aToggler.setAttribute('ordinal', 5);
|
aToggler.setAttribute('ordinal', 5);
|
||||||
aTabBrowser.mPanelContainer.setAttribute('ordinal', 30);
|
aTabBrowser.mPanelContainer.setAttribute('ordinal', 30);
|
||||||
@ -1044,6 +1073,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.updateTabbarState();
|
this.updateTabbarState();
|
||||||
window.setTimeout(function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
window.setTimeout(function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
||||||
delayedPostProcess(aSelf, aTabBrowser, aSplitter, aToggler);
|
delayedPostProcess(aSelf, aTabBrowser, aSplitter, aToggler);
|
||||||
|
aSelf.updateTabbarSize();
|
||||||
aSelf.updateTabbarOverflow();
|
aSelf.updateTabbarOverflow();
|
||||||
delayedPostProcess = null;
|
delayedPostProcess = null;
|
||||||
aSelf.mTabBrowser.style.visibility = '';
|
aSelf.mTabBrowser.style.visibility = '';
|
||||||
@ -1125,6 +1155,27 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.updateAllTabsIndent();
|
this.updateAllTabsIndent();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateTabbarSize : function TSTBrowser_updateTabbarSize()
|
||||||
|
{
|
||||||
|
var placeholder = this.placeholder;
|
||||||
|
if (!placeholder) return;
|
||||||
|
|
||||||
|
var strip = this.tabStrip;
|
||||||
|
var box = placeholder.boxObject;
|
||||||
|
if (this.currentTabbarPosition == 'top') {
|
||||||
|
strip.style.position = 'static';
|
||||||
|
strip.style.MozAppearance = '';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
strip.style.position = 'fixed';
|
||||||
|
strip.style.top = box.y;
|
||||||
|
strip.style.left = box.x;
|
||||||
|
strip.style.MozAppearance = 'none';
|
||||||
|
strip.style.width = (strip.width = box.width)+'px';
|
||||||
|
strip.style.height = (strip.height = box.height)+'px';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
updateTabbarOverflow : function TSTBrowser_updateTabbarOverflow()
|
updateTabbarOverflow : function TSTBrowser_updateTabbarOverflow()
|
||||||
{
|
{
|
||||||
var b = this.mTabBrowser;
|
var b = this.mTabBrowser;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user