Make column width configurable

This commit is contained in:
Piro / YUKI Hiroshi 2016-03-05 14:47:55 +09:00
parent f43aa54ea0
commit 32d71fb1f1
4 changed files with 9 additions and 2 deletions

View File

@ -346,6 +346,7 @@ pref("extensions.treestyletab.tooltip.fullTooltipDelay", 2000);
* If true, too many items are shown in multiple columns.
*/
pref("extensions.treestyletab.tooltip.columnize", true);
pref("extensions.treestyletab.tooltip.columnize.width", "20em");
/**
* Visibility of extra menu items for the context menu on tabs, inserted by TST.
@ -662,6 +663,7 @@ 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);
pref("extensions.treestyletab.groupTab.columnize.width", "20em");
/**
* Compatibility hack flags for other addons. They can be disabled by each

View File

@ -574,6 +574,7 @@ FullTooltipManager.prototype = inherit(TreeStyleTabBase, {
var columnize = utils.getTreePref('tooltip.columnize');
if (columnize) {
PseudoTreeBuilder.columnizeTree(tree, {
columnWidth : utils.getTreePref('tooltip.columnize.width'),
containerBox : {
width : this.lastScreen.allowedWidth,
height : this.lastScreen.allowedHeight

View File

@ -411,7 +411,9 @@ GroupTab.prototype = inherit(TreeStyleTabBase, {
return;
var container = this.document.getElementById('tree');
var tree = container.firstChild;
PseudoTreeBuilder.columnizeTree(tree);
PseudoTreeBuilder.columnizeTree(tree, {
columnWidth : utils.getTreePref('groupTab.columnize.width')
});
},
onTabAttached : function GT_onTabAttached(aEvent)

View File

@ -152,9 +152,11 @@ var PseudoTreeBuilder = {
return;
aOptions = aOptions || {};
aOptions.width = aOptions.width || '20em';
var style = aTree.style;
style.columnWidth = style.MozColumnWidth = 'calc(20em)';
style.columnWidth = style.MozColumnWidth = 'calc(' + aOptions.width + ')';
{
let computedStyle = aTree.ownerDocument.defaultView.getComputedStyle(aTree, null)
aTree.columnWidth = Number((computedStyle.MozColumnWidth || computedStyle.columnWidth).replace(/px/, ''));