Make column width configurable
This commit is contained in:
parent
f43aa54ea0
commit
32d71fb1f1
@ -346,6 +346,7 @@ pref("extensions.treestyletab.tooltip.fullTooltipDelay", 2000);
|
|||||||
* If true, too many items are shown in multiple columns.
|
* If true, too many items are shown in multiple columns.
|
||||||
*/
|
*/
|
||||||
pref("extensions.treestyletab.tooltip.columnize", true);
|
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.
|
* 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.
|
* 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", true);
|
||||||
|
pref("extensions.treestyletab.groupTab.columnize.width", "20em");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compatibility hack flags for other addons. They can be disabled by each
|
* Compatibility hack flags for other addons. They can be disabled by each
|
||||||
|
@ -574,6 +574,7 @@ FullTooltipManager.prototype = inherit(TreeStyleTabBase, {
|
|||||||
var columnize = utils.getTreePref('tooltip.columnize');
|
var columnize = utils.getTreePref('tooltip.columnize');
|
||||||
if (columnize) {
|
if (columnize) {
|
||||||
PseudoTreeBuilder.columnizeTree(tree, {
|
PseudoTreeBuilder.columnizeTree(tree, {
|
||||||
|
columnWidth : utils.getTreePref('tooltip.columnize.width'),
|
||||||
containerBox : {
|
containerBox : {
|
||||||
width : this.lastScreen.allowedWidth,
|
width : this.lastScreen.allowedWidth,
|
||||||
height : this.lastScreen.allowedHeight
|
height : this.lastScreen.allowedHeight
|
||||||
|
@ -411,7 +411,9 @@ GroupTab.prototype = inherit(TreeStyleTabBase, {
|
|||||||
return;
|
return;
|
||||||
var container = this.document.getElementById('tree');
|
var container = this.document.getElementById('tree');
|
||||||
var tree = container.firstChild;
|
var tree = container.firstChild;
|
||||||
PseudoTreeBuilder.columnizeTree(tree);
|
PseudoTreeBuilder.columnizeTree(tree, {
|
||||||
|
columnWidth : utils.getTreePref('groupTab.columnize.width')
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onTabAttached : function GT_onTabAttached(aEvent)
|
onTabAttached : function GT_onTabAttached(aEvent)
|
||||||
|
@ -152,9 +152,11 @@ var PseudoTreeBuilder = {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
aOptions = aOptions || {};
|
aOptions = aOptions || {};
|
||||||
|
aOptions.width = aOptions.width || '20em';
|
||||||
|
|
||||||
var style = aTree.style;
|
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)
|
let computedStyle = aTree.ownerDocument.defaultView.getComputedStyle(aTree, null)
|
||||||
aTree.columnWidth = Number((computedStyle.MozColumnWidth || computedStyle.columnWidth).replace(/px/, ''));
|
aTree.columnWidth = Number((computedStyle.MozColumnWidth || computedStyle.columnWidth).replace(/px/, ''));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user