From 07675ecebcfa099fe20d94cb0cbebb0d63dc9c34 Mon Sep 17 00:00:00 2001 From: SHIMODA Hiroshi Date: Wed, 30 Mar 2011 13:04:29 +0900 Subject: [PATCH] * set minimum indent width to 3px * new secret prefs to disable auto-shrinking of indent --- content/treestyletab/treestyletabbrowser.js | 7 ++++++- defaults/preferences/treestyletab.js | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 725f21bb..23b62d4b 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -4345,6 +4345,11 @@ TreeStyleTabBrowser.prototype = { checkTabsIndentOverflowTimer : null, checkTabsIndentOverflowCallback : function TSTBrowser_checkTabsIndentOverflowCallback() { + if (!this.getTreePref('indent.autoShrink')) { + this.indent = -1; + return; + } + var b = this.mTabBrowser; var tabs = this.getArrayFromXPathResult(this.evaluateXPath( 'child::xul:tab[@'+this.kNEST+' and not(@'+this.kNEST+'="0" or @'+this.kNEST+'="")]', @@ -4374,7 +4379,7 @@ TreeStyleTabBrowser.prototype = { } var maxIndent = maxIndentBase * (this.isVertical ? 0.33 : 0.5 ); - var indentUnit = Math.max(Math.floor(maxIndent / nest), 1); + var indentUnit = Math.max(Math.floor(maxIndent / nest), this.getTreePref('indent.min')); if (indent > maxIndent) { this.indent = indentUnit; } diff --git a/defaults/preferences/treestyletab.js b/defaults/preferences/treestyletab.js index 4543a9dd..79517195 100644 --- a/defaults/preferences/treestyletab.js +++ b/defaults/preferences/treestyletab.js @@ -55,7 +55,9 @@ pref("extensions.treestyletab.maxTreeLevel.horizontal", 0); pref("extensions.treestyletab.maxTreeLevel.vertical", 999); pref("extensions.treestyletab.maxTreeLevel.phisical", false); pref("extensions.treestyletab.indent", 12); +pref("extensions.treestyletab.indent.min", 3); pref("extensions.treestyletab.indent.property", "margin"); +pref("extensions.treestyletab.indent.autoShrink", true); // pref("extensions.treestyletab.indent.property.top", ""); // pref("extensions.treestyletab.indent.property.right", ""); // pref("extensions.treestyletab.indent.property.bottom", "");