Merge branch 'master' of github.com:piroor/treestyletab
This commit is contained in:
commit
d1977a1695
@ -271,8 +271,10 @@ pref("extensions.treestyletab.maxTreeLevel.phisical", false);
|
|||||||
* If you set "autoShrink.onlyForVisible" to "false", TST keeps indent size
|
* If you set "autoShrink.onlyForVisible" to "false", TST keeps indent size
|
||||||
* shrunken even if "too deeply nested" tabs are invisible.
|
* shrunken even if "too deeply nested" tabs are invisible.
|
||||||
*/
|
*/
|
||||||
pref("extensions.treestyletab.indent", 12);
|
pref("extensions.treestyletab.indent.vertical", 12);
|
||||||
pref("extensions.treestyletab.indent.min", 3);
|
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", true);
|
||||||
pref("extensions.treestyletab.indent.autoShrink.onlyForVisible", true);
|
pref("extensions.treestyletab.indent.autoShrink.onlyForVisible", true);
|
||||||
/**
|
/**
|
||||||
|
@ -163,6 +163,10 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
},
|
},
|
||||||
_maxTreeLevel : -1,
|
_maxTreeLevel : -1,
|
||||||
|
|
||||||
|
get baseIndent() {
|
||||||
|
return this.isVertical ? this.baseIndentVertical : this.baseIndentHorizontal;
|
||||||
|
},
|
||||||
|
|
||||||
get enableSubtreeIndent()
|
get enableSubtreeIndent()
|
||||||
{
|
{
|
||||||
return this._enableSubtreeIndent;
|
return this._enableSubtreeIndent;
|
||||||
@ -5295,15 +5299,17 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.getFirstNormalTab(b).boxObject[this.invertedSizeProp],
|
this.getFirstNormalTab(b).boxObject[this.invertedSizeProp],
|
||||||
b.mTabContainer.boxObject[this.invertedSizeProp]
|
b.mTabContainer.boxObject[this.invertedSizeProp]
|
||||||
);
|
);
|
||||||
if (!this.isVertical) {
|
var isVertical = this.isVertical;
|
||||||
|
if (!isVertical) {
|
||||||
if (this._horizontalTabMaxIndentBase)
|
if (this._horizontalTabMaxIndentBase)
|
||||||
maxIndentBase = this._horizontalTabMaxIndentBase;
|
maxIndentBase = this._horizontalTabMaxIndentBase;
|
||||||
else
|
else
|
||||||
this._horizontalTabMaxIndentBase = maxIndentBase;
|
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) {
|
if (indent > maxIndent) {
|
||||||
this.indent = indentUnit;
|
this.indent = indentUnit;
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,8 @@ var TreeStyleTabUtils = {
|
|||||||
DEFAULT_SHRUNKEN_WIDTH_RATIO : 0.67,
|
DEFAULT_SHRUNKEN_WIDTH_RATIO : 0.67,
|
||||||
|
|
||||||
/* base variables */
|
/* base variables */
|
||||||
baseIndent : 12,
|
baseIndentVertical : 12,
|
||||||
|
baseIndentHorizontal : 4,
|
||||||
shouldDetectClickOnIndentSpaces : true,
|
shouldDetectClickOnIndentSpaces : true,
|
||||||
|
|
||||||
smoothScrollEnabled : true,
|
smoothScrollEnabled : true,
|
||||||
@ -360,7 +361,8 @@ var TreeStyleTabUtils = {
|
|||||||
|
|
||||||
this.addPrefListener(this);
|
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('extensions.treestyletab.clickOnIndentSpaces.enabled');
|
||||||
this.onPrefChange('browser.tabs.loadFolderAndReplace.override');
|
this.onPrefChange('browser.tabs.loadFolderAndReplace.override');
|
||||||
this.onPrefChange('browser.tabs.insertRelatedAfterCurrent.override');
|
this.onPrefChange('browser.tabs.insertRelatedAfterCurrent.override');
|
||||||
@ -413,7 +415,7 @@ var TreeStyleTabUtils = {
|
|||||||
this.setDefaultPref(key, this.getPref(originalKey));
|
this.setDefaultPref(key, this.getPref(originalKey));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
kPREF_VERSION : 8,
|
kPREF_VERSION : 9,
|
||||||
migratePrefs : function TSTUtils_migratePrefs()
|
migratePrefs : function TSTUtils_migratePrefs()
|
||||||
{
|
{
|
||||||
// migrate old prefs
|
// migrate old prefs
|
||||||
@ -517,6 +519,11 @@ var TreeStyleTabUtils = {
|
|||||||
if (delay !== null)
|
if (delay !== null)
|
||||||
this.setTreePref('autoExpandSubtreeOnSelect.whileFocusMovingByShortcut.delay', delay);
|
this.setTreePref('autoExpandSubtreeOnSelect.whileFocusMovingByShortcut.delay', delay);
|
||||||
}
|
}
|
||||||
|
case 8:
|
||||||
|
orientalPrefs = orientalPrefs.concat([
|
||||||
|
'extensions.treestyletab.indent',
|
||||||
|
'extensions.treestyletab.indent.min'
|
||||||
|
]);
|
||||||
default:
|
default:
|
||||||
for (let i = 0, maxi = orientalPrefs.length; i < maxi; i++)
|
for (let i = 0, maxi = orientalPrefs.length; i < maxi; i++)
|
||||||
{
|
{
|
||||||
@ -2696,8 +2703,12 @@ var TreeStyleTabUtils = {
|
|||||||
var value = this.getPref(aPrefName);
|
var value = this.getPref(aPrefName);
|
||||||
switch (aPrefName)
|
switch (aPrefName)
|
||||||
{
|
{
|
||||||
case 'extensions.treestyletab.indent':
|
case 'extensions.treestyletab.indent.vertical':
|
||||||
this.baseIndent = value;
|
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);
|
this.ObserverService.notifyObservers(null, this.kTOPIC_INDENT_MODIFIED, value);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user