Setting the color of head lines actually is quite easy. I changed the 
method 'setItemText' in 'baseNativeTree.py' as follows:

def setItemText (self,item,s):

    if item:
        #RE: additions for colorizing some nodes
        s = s.lstrip()
        brush = QtGui.QBrush()
        if s.startswith("@file"):    
            brush.setColor(QtGui.QColor('green')) 
        elif s.startswith("class"):
            brush.setColor(QtGui.QColor('blue')) 
        elif s.startswith("<<"):
            brush.setColor(QtGui.QColor('red')) 
        elif s.startswith("#"):
            brush.setColor(QtGui.QColor('brown')) 
        elif s.lstrip().startswith("<<"):
            brush.setColor(QtGui.QColor('red')) 
        else:
            brush.setColor(QtGui.QColor('black'))
        item.setForeground(0, brush)
        #RE: end of additions
            
        item.setText(0,s)

The following picture shows the result:

<https://lh5.googleusercontent.com/-LuQRumPclzQ/UzlPbVs6rbI/AAAAAAAAADc/_vCt0i-Jawg/s1600/ColorizedOutline.png>


I know, that is no general or permanent solution, and it doesn't use the 
Leo (color) code base, but it helps to understand the code.

Reinhard

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to