スプリッタのダブルクリックでタブバーの幅・高さを初期値にリセットするようにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6446 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-03-25 10:19:29 +00:00
parent 8f8bbda446
commit 4071e166ca

View File

@ -1088,6 +1088,7 @@ TreeStyleTabBrowser.prototype = {
try {
splitter.removeEventListener('mouseup', this, false);
splitter.removeEventListener('click', this, false);
splitter.removeEventListener('dblclick', this, false);
}
catch(e) {
}
@ -1108,6 +1109,7 @@ TreeStyleTabBrowser.prototype = {
splitter.addEventListener('mouseup', this, false);
splitter.addEventListener('click', this, false);
splitter.addEventListener('dblclick', this, false);
var ref = this.mTabBrowser.mPanelContainer;
ref.parentNode.insertBefore(splitter, ref);
@ -1203,6 +1205,25 @@ TreeStyleTabBrowser.prototype = {
}
},
resetTabbarSize : function TSTBrowser_resetTabbarSize()
{
if (!this.isVertical) {
this.clearTreePref('tabbar.height');
if (this.placeholder) {
let tabs = this.mTabBrowser.mTabContainer;
tabs.removeAttribute('height');
this.placeholder.height = tabs.boxObject.height;
this.updateFloatingTabbar();
}
}
else {
if (!this.autoHide.expanded)
this.clearTreePref('tabbar.shrunkenWidth');
else
this.clearTreePref('tabbar.width');
}
},
updateTabbarOverflow : function TSTBrowser_updateTabbarOverflow()
{
var b = this.mTabBrowser;
@ -2555,13 +2576,21 @@ TreeStyleTabBrowser.prototype = {
onDblClick : function TSTBrowser_onDblClick(aEvent)
{
var tab = this.getTabFromEvent(aEvent);
if (tab &&
this.hasChildTabs(tab) &&
this.getTreePref('collapseExpandSubtree.dblclick')) {
this.collapseExpandSubtree(tab, tab.getAttribute(this.kSUBTREE_COLLAPSED) != 'true');
aEvent.preventDefault();
aEvent.stopPropagation();
switch (aEvent.currentTarget.localName)
{
case 'splitter':
return this.resetTabbarSize();
default:
let tab = this.getTabFromEvent(aEvent);
if (tab &&
this.hasChildTabs(tab) &&
this.getTreePref('collapseExpandSubtree.dblclick')) {
this.collapseExpandSubtree(tab, tab.getAttribute(this.kSUBTREE_COLLAPSED) != 'true');
aEvent.preventDefault();
aEvent.stopPropagation();
}
return;
}
},