Add secret preferences to disable multicolumn pseud tree

* extensions.treestyletab.groupTab.columnize
 * extensions.treestyletab.tooltip.columnize
This commit is contained in:
Piro / YUKI Hiroshi 2016-02-16 01:32:56 +09:00
parent 0d6e26585e
commit d1200d2264
3 changed files with 25 additions and 4 deletions

View File

@ -348,6 +348,10 @@ pref("extensions.treestyletab.tooltip.maxCount", 10);
* Negative value means "do not show full tooltip".
*/
pref("extensions.treestyletab.tooltip.fullTooltipDelay", 2000);
/**
* If true, too many items are shown in multiple columns.
*/
pref("extensions.treestyletab.tooltip.columnize", true);
/**
* Visibility of extra menu items for the context menu on tabs, inserted by TST.
@ -660,6 +664,11 @@ pref("extensions.treestyletab.createSubtree.underParent.temporaryGroup", true);
*/
pref("extensions.treestyletab.pinnedTab.faviconized", true);
/**
* If true, too many items are shown in multiple columns in a dummy (group) tab.
*/
pref("extensions.treestyletab.groupTab.columnize", true);
/**
* Compatibility hack flags for other addons. They can be disabled by each
* addon, when the addon become working with TST without dirty hacks.

View File

@ -212,14 +212,19 @@ FullTooltipManager.prototype = inherit(TreeStyleTabBase, {
{
this.startListenTooltipEvents();
var tooltip = this.tabFullTooltip;
var currentScreen = this.getCurrentScreen(tooltip.boxObject);
var tree = tooltip.lastChild.lastChild.lastChild;
if (utils.getTreePref('tooltip.columnize')) {
let tooltip = this.tabFullTooltip;
let currentScreen = this.getCurrentScreen(tooltip.boxObject);
let tree = tooltip.lastChild.lastChild.lastChild;
PseudoTreeBuilder.columnizeTree(tree, {
width : currentScreen.allowedWidth,
height : currentScreen.allowedHeight
});
this.window.setTimeout(this.resizeTooltip.bind(this), 0);
}
else {
this.resizeTooltip();
}
},
resizeTooltip : function FTM_resizeTooltip()
{
@ -473,7 +478,8 @@ FullTooltipManager.prototype = inherit(TreeStyleTabBase, {
var tree = PseudoTreeBuilder.build(aTab);
var root = this.document.createElement('arrowscrollbox');
root.setAttribute('orient', 'horizontal');
var orient = utils.getTreePref('tooltip.columnize') ? 'horizontal' : 'vertical' ;
root.setAttribute('orient', orient);
root.setAttribute('flex', 1);
var container = root.appendChild(this.document.createElement('vbox'));

View File

@ -39,11 +39,15 @@ var EXPORTED_SYMBOLS = ['GroupTab'];
const Cc = Components.classes;
const Ci = Components.interfaces;
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
Components.utils.import('resource://treestyletab-modules/lib/inherit.jsm');
Components.utils.import('resource://treestyletab-modules/base.js');
Components.utils.import('resource://treestyletab-modules/pseudoTreeBuilder.js');
Components.utils.import('resource://treestyletab-modules/tabAttributesObserver.js');
XPCOMUtils.defineLazyModuleGetter(this, 'utils', 'resource://treestyletab-modules/utils.js', 'TreeStyleTabUtils');
function GroupTab(aWindow)
{
this.window = aWindow;
@ -403,6 +407,8 @@ GroupTab.prototype = inherit(TreeStyleTabBase, {
onResize : function GT_onResize()
{
if (!utils.getTreePref('groupTab.columnize'))
return;
var container = this.document.getElementById('tree');
var tree = container.firstChild;
PseudoTreeBuilder.columnizeTree(tree);