borderによるインデントで、一番内側の線の色を変えるようにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1817 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2008-02-22 08:50:18 +00:00
parent 2ae7043475
commit 333e8935a4
2 changed files with 17 additions and 3 deletions

View File

@ -376,7 +376,7 @@ TreeStyleTabService.overrideExtensionsAfterInit = function() {
window.getRowHeight.toSource().replace(
'var tabs = getBrowser().mTabContainer.childNodes;',
<><![CDATA[
var tabsResult = TreeStyleTabService.getVisibleTabs(getBrowser.selectedTab);
var tabsResult = TreeStyleTabService.getVisibleTabs(getBrowser().selectedTab);
var tabs = [];
for (var t = 0, maxt = tabsResult.snapshotLength; t < maxt; t++)
tabs.push(tabsResult.snapshotItem(t));

View File

@ -1912,16 +1912,30 @@ TreeStyleTabBrowser.prototype = {
var multirow = this.isMultiRow();
var topBottom = this.levelMarginProp.match(/top|bottom/);
var innerBoxes, j;
var innerBoxes,
j,
colors,
maxIndent = parseInt(aTabs[0].boxObject.height / 2);
dump(aLevel+'/'+maxIndent+'\n');
for (var i = 0, maxi = aTabs.length; i < maxi; i++)
{
if (multirow) {
indent = Math.min(aLevel * 3, maxIndent);
innerBoxes = document.getAnonymousNodes(aTabs[i]);
colors = '-moz-border-top-colors:'+(function(aNum) {
var retVal = [];
for (var i = 1; i < aNum; i++)
{
retVal.push('transparent');
}
retVal.push('ThreeDShadow');
return retVal.length == 1 ? 'none' : retVal.join(' ') ;
})(indent)+' !important;';
for (j = 0, maxj = innerBoxes.length; j < maxj; j++)
{
if (innerBoxes[j].nodeType != Node.ELEMENT_NODE) continue;
innerBoxes[j].setAttribute('style', innerBoxes[j].getAttribute('style').replace(/border-(top|bottom).*:[^;]+;?/g, '')+'; border-'+topBottom+': solid transparent '+(aLevel * 4)+'px !important;');
innerBoxes[j].setAttribute('style', innerBoxes[j].getAttribute('style').replace(/(-moz-)?border-(top|bottom)(-[^:]*)?.*:[^;]+;?/g, '')+'; border-'+topBottom+': solid transparent '+indent+'px !important;'+colors);
}
}
else {