Thanks for the responses, everyone. I think I understand
things a little better now, but I still have some questions
for which I'm having trouble finding the answers myself.
In addition to the stuff referred to in your answers, I also
looked at this page:
https://developer.mozilla.org/en/XUL_Tutorial/Styling_a_Tree
I should mention that although I maintain four different TB
addons, none of them have had to deal with stylesheets, so
working with styles in Gecko / XUL is new to me. I confess I'm
finding it a bit confusing and complicated, but perhaps it'll
get easier when I get the hang of it.
From your answers, it seems to me that I want to create and
overlay a stylesheet which tells Thunderbird to color the text
of the cells in the treeview a certain color based on a
property indicating the priority of the message in that row.
For example, my stylesheet might have this in it:
treechildren::-moz-tree-cell-text(priority-highest) {
color: red;
}
to indicate that highest-priority messages should show up in
red (or bold, or italic, or a larger font, whatever I decide
is appropriate, or perhaps even let the user customize the
styles).
Then, I need to put some code somewhere to set the appropriate
property on all the cells in the row based on the Priority
setting for the message represented by that row. Once the
property is added to the cells, they'll be colored
automatically based on the stylesheet.
But how do I get that code to execute? I don't think I can use
a custom column handler for all the existing thread pane
columns, because the columns already have column handlers, and
I don't think a column is allowed to have multiple handlers.
Am I right about all that?
I also don't think I can execute the code in the
getCellProperties of a view object as described in the
Styling_a_Tree page, because the thread view already has a
view object and I can't very well replace it with mine. Or
maybe I am indeed supposed to overload the view object,
allowing most calls into it to pass through into the original,
but intercepting getCellProperties calls to mess with them as
needed? That just doesn't seem right.
Here's another thing I don't understand... I see definitions
in this file that Jim referenced:
http://mxr.mozilla.org/comm-central/source/mail/themes/qute/mail/tagColors.css
that look like this:
treechildren::-moz-tree-cell-text(lc-FFFFFF), .lc-FFFFFF:not([_moz-menuactive]) {
color: #FFFFFF
}
treechildren::-moz-tree-row(lc-FFFFFF, selected, focus), .blc-FFFFFF {
background-color: #FFFFFF;
}
.blc-FFFFFF {
border-color: #FFFFFF;
}
If I understand this correctly, what it's saying is that when
a particular row is selected, it should have a background
color as indicated (that's the ".blc-FFFFFF"), but when it's
not selected, it should have that as the text color instead
of the background color (that's the ".lc-FFFFFF").
So I then went searching to find out what adds the .blc-* and
.lc-* properties to the cells, and for the life of me I can't
find it. I found code which seems to build the tag menus, and
which seems to build the tags column value, but for the life
of me I can't find the code which styles the rows themselves
based on their tag values.
Oh, and one more question which is probably more general than
the others... If I do decide to let the add-on user customize
the styles for the different priority values, then I guess
I'm going to have to overlay the thread view with dynamically
generated styles. Is that possible?
I know this is a lot of questions. I feel like I'm sort of
asking you all to do the work of writing the add-on for me,
for which I apologize. On the bright side, once I get it
written, I'll be the one maintaining it. :-) I don't want to
impose on, but if any of you feel like helping me out with
another push or two in the right direction, I'd be much
obliged.