ColorfulTabsを導入している場合、子供のタブは親のタブの色を継承するようにした
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1951 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
ccf7687592
commit
f88984a12e
@ -495,4 +495,20 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ColorfulTab
|
||||||
|
if ('clrtabsInit' in window) {
|
||||||
|
this.registerAttachTabPostProcess(function(aChild, aParent, aService) {
|
||||||
|
if (aChild && aParent) {
|
||||||
|
setColor(aChild, aService.SessionStore.getTabValue(aParent, 'tabClr'));
|
||||||
|
}
|
||||||
|
else if (aChild) {
|
||||||
|
aService.SessionStore.setTabValue(aChild, 'tabClr', '')
|
||||||
|
calcTabClr({
|
||||||
|
target : aChild,
|
||||||
|
originalTarget : aChild,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1439,6 +1439,12 @@ catch(e) {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
registerAttachTabPostProcess : function(aProcess)
|
||||||
|
{
|
||||||
|
this._attachTabPostProcesses.push(aProcess);
|
||||||
|
},
|
||||||
|
_attachTabPostProcesses : [],
|
||||||
|
|
||||||
/* Pref Listener */
|
/* Pref Listener */
|
||||||
|
|
||||||
domain : 'extensions.treestyletab',
|
domain : 'extensions.treestyletab',
|
||||||
|
@ -1992,8 +1992,10 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
!aParent ||
|
!aParent ||
|
||||||
aChild == aParent ||
|
aChild == aParent ||
|
||||||
this.getParentTab(aChild) == aParent
|
this.getParentTab(aChild) == aParent
|
||||||
)
|
) {
|
||||||
|
this.attachTabPostProcess(aChild, aParent);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!aInfo) aInfo = {};
|
if (!aInfo) aInfo = {};
|
||||||
|
|
||||||
@ -2072,6 +2074,15 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.updateTabsIndent([aChild]);
|
this.updateTabsIndent([aChild]);
|
||||||
this.checkTabsIndentOverflow();
|
this.checkTabsIndentOverflow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.attachTabPostProcess(aChild, aParent);
|
||||||
|
},
|
||||||
|
attachTabPostProcess : function(aChild, aParent)
|
||||||
|
{
|
||||||
|
var self = this;
|
||||||
|
this._attachTabPostProcesses.forEach(function(aProcess) {
|
||||||
|
aProcess(aChild, aParent, self);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
partTab : function(aChild, aDontUpdateIndent)
|
partTab : function(aChild, aDontUpdateIndent)
|
||||||
@ -2093,6 +2104,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.updateTabsIndent([aChild]);
|
this.updateTabsIndent([aChild]);
|
||||||
this.checkTabsIndentOverflow();
|
this.checkTabsIndentOverflow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.attachTabPostProcess(aChild, null);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateTabsIndent : function(aTabs, aLevel, aProp)
|
updateTabsIndent : function(aTabs, aLevel, aProp)
|
||||||
|
Loading…
Reference in New Issue
Block a user