Merge branch 'master' of github.com:piroor/treestyletab

This commit is contained in:
YUKI Hiroshi 2012-09-03 10:25:29 +09:00
commit d1977a1695
3 changed files with 29 additions and 10 deletions

View File

@ -271,8 +271,10 @@ pref("extensions.treestyletab.maxTreeLevel.phisical", false);
* If you set "autoShrink.onlyForVisible" to "false", TST keeps indent size
* shrunken even if "too deeply nested" tabs are invisible.
*/
pref("extensions.treestyletab.indent", 12);
pref("extensions.treestyletab.indent.min", 3);
pref("extensions.treestyletab.indent.vertical", 12);
pref("extensions.treestyletab.indent.horizontal", 4);
pref("extensions.treestyletab.indent.min.vertical", 3);
pref("extensions.treestyletab.indent.min.horizontal", 1);
pref("extensions.treestyletab.indent.autoShrink", true);
pref("extensions.treestyletab.indent.autoShrink.onlyForVisible", true);
/**

View File

@ -163,6 +163,10 @@ TreeStyleTabBrowser.prototype = {
},
_maxTreeLevel : -1,
get baseIndent() {
return this.isVertical ? this.baseIndentVertical : this.baseIndentHorizontal;
},
get enableSubtreeIndent()
{
return this._enableSubtreeIndent;
@ -5295,15 +5299,17 @@ TreeStyleTabBrowser.prototype = {
this.getFirstNormalTab(b).boxObject[this.invertedSizeProp],
b.mTabContainer.boxObject[this.invertedSizeProp]
);
if (!this.isVertical) {
var isVertical = this.isVertical;
if (!isVertical) {
if (this._horizontalTabMaxIndentBase)
maxIndentBase = this._horizontalTabMaxIndentBase;
else
this._horizontalTabMaxIndentBase = maxIndentBase;
}
var maxIndent = maxIndentBase * (this.isVertical ? 0.33 : 0.5 );
var maxIndent = maxIndentBase * (isVertical ? 0.33 : 0.5 );
var indentUnit = Math.max(Math.floor(maxIndent / nest), this.getTreePref('indent.min'));
var indentMin = this.getTreePref(isVertical ? 'indent.min.vertical' : 'indent.min.horizontal');
var indentUnit = Math.max(Math.floor(maxIndent / nest), indentMin);
if (indent > maxIndent) {
this.indent = indentUnit;
}

View File

@ -250,7 +250,8 @@ var TreeStyleTabUtils = {
DEFAULT_SHRUNKEN_WIDTH_RATIO : 0.67,
/* base variables */
baseIndent : 12,
baseIndentVertical : 12,
baseIndentHorizontal : 4,
shouldDetectClickOnIndentSpaces : true,
smoothScrollEnabled : true,
@ -360,7 +361,8 @@ var TreeStyleTabUtils = {
this.addPrefListener(this);
this.onPrefChange('extensions.treestyletab.indent');
this.onPrefChange('extensions.treestyletab.indent.vertical');
this.onPrefChange('extensions.treestyletab.indent.horizontal');
this.onPrefChange('extensions.treestyletab.clickOnIndentSpaces.enabled');
this.onPrefChange('browser.tabs.loadFolderAndReplace.override');
this.onPrefChange('browser.tabs.insertRelatedAfterCurrent.override');
@ -413,7 +415,7 @@ var TreeStyleTabUtils = {
this.setDefaultPref(key, this.getPref(originalKey));
}
},
kPREF_VERSION : 8,
kPREF_VERSION : 9,
migratePrefs : function TSTUtils_migratePrefs()
{
// migrate old prefs
@ -517,6 +519,11 @@ var TreeStyleTabUtils = {
if (delay !== null)
this.setTreePref('autoExpandSubtreeOnSelect.whileFocusMovingByShortcut.delay', delay);
}
case 8:
orientalPrefs = orientalPrefs.concat([
'extensions.treestyletab.indent',
'extensions.treestyletab.indent.min'
]);
default:
for (let i = 0, maxi = orientalPrefs.length; i < maxi; i++)
{
@ -2696,8 +2703,12 @@ var TreeStyleTabUtils = {
var value = this.getPref(aPrefName);
switch (aPrefName)
{
case 'extensions.treestyletab.indent':
this.baseIndent = value;
case 'extensions.treestyletab.indent.vertical':
this.baseIndentVertical = value;
this.ObserverService.notifyObservers(null, this.kTOPIC_INDENT_MODIFIED, value);
return;
case 'extensions.treestyletab.indent.horizontal':
this.baseIndentHorizontal = value;
this.ObserverService.notifyObservers(null, this.kTOPIC_INDENT_MODIFIED, value);
return;