disable highlighting of selected message

Discussion of general topics about Mozilla Thunderbird
Post Reply
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

disable highlighting of selected message

Post by chrizoo »

I fail to disable the color highlighting of the selected message.
Why do I need to do this? For the following reason:

I styled my tags to have background-colors (for better visual emphasis):

my userChrome.css:

Code: Select all

/* important = red */
#threadTree > treechildren::-moz-tree-cell(lc-FF0000) {background-color:red!important}
#threadTree > treechildren::-moz-tree-cell-text(lc-FF0000) {color:white!important}

/* 2do = orange */
#threadTree > treechildren::-moz-tree-cell(lc-FF9900) {background-color:#FF9900!important}
#threadTree > treechildren::-moz-tree-cell-text(lc-FF9900) {color:white!important}

/* friends = blue */
#threadTree > treechildren::-moz-tree-cell(lc-3366FF) {background-color:#0066FF!important}
#threadTree > treechildren::-moz-tree-cell-text(lc-3366FF) {color:white!important}
Now I obviously have to change the look of the cursor (i.e. selected message) to be distinguishable from my tagged messages.
My choice is a 1px dashed border and no background-color (i.e. a dashed cursor inside of which everything remains as is):

Code: Select all

#threadTree > treechildren::-moz-tree-row(selected,focus) {border:1px dashed black !important; background-color:transparent!important}
This works. I get the dashed border and transparent (i.e. unchanged) background-color: white for untagged messages, tag-color for tagged messages.

But this causes the text to disappear on untagged messages. I guess I now have white text on white background (since normally the selected message is displayed with white text on blue background, so when I disable the blue, I obviously get white-on-white).

So how can I prevent Thunderbird from setting the text-color of selected messages to white ?

I can set -moz-tree-cell-text color to black, which brings back the text, but the problem is, it is black for ALL messages. So a tagged message with, say, pink text color (determined by the tag) turns black when selected. But I want it to stay pink when selected:

Image

I tried various keywords instead of "black", but none of them worked:

Code: Select all

inherit
initial
currentColor
Highlight
HighlightText
-moz-CellHighlight
-moz-CellHighlightText
-moz-html-CellHighlight
-moz-html-CellHighlightText
-moz-DialogText
I also tried -moz-appearance:none!important to no avail.

So my question is:
How can I disable the text color of selected messages (without the aforementioned negative side-effects) ?

Once selected, Thunderbird turns the text color white. So it seems I'd need to
– either tell Thunderbird to use the tag color instead of white,
– or prevent "white" to be assigned in the first place (I thought "inherit" should work, but it doesn't),
– or maybe you know another solution altogether ?

Do you know, how to solve this problem?
Thank you.

PS: As you can see from the gif animation, the border style is lost on the yellow tagged eMail.
I would also be thankful for an explanation why this occurs and how to prevent that.
Last edited by chrizoo on October 3rd, 2018, 4:14 pm, edited 3 times in total.
Bozz
Posts: 2684
Joined: October 18th, 2007, 1:53 pm

Re: disable background-color of selected message

Post by Bozz »

Maybe try adding (selected, focus) or (selected) tag lines in addition to your other tag lines. I don't know for sure.
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

Re: disable background-color of selected message

Post by chrizoo »

Thanks for looking into this.

You mean in my 1st codebox? The 1st codebox works fine. The problem is not even with tags overriden by userChrome.css, but by tags NOT overriden by userChrome.css. (In fact the first half of my posting only explains how I got there.)

Say I add a tag with green color (via tools > options > display > tags > edit), then I tag a message with that --> The message turns green.
But I don't know how to preserve this green color when disabling the selected message's background-color.
morat
Posts: 6403
Joined: February 3rd, 2009, 6:29 pm

Re: disable highlighting of selected message

Post by morat »

Here is the css file for tag colors.

Reference
http://dxr.mozilla.org/comm-esr60/searc ... Colors.css
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

Re: disable highlighting of selected message

Post by chrizoo »

thanks morat, but sorry I don't understand – what are you suggesting I should do with the .css file you posted ?
morat
Posts: 6403
Joined: February 3rd, 2009, 6:29 pm

Re: disable highlighting of selected message

Post by morat »

I don't know if I understand what you want, but try something like:

Code: Select all

#threadTree > treechildren::-moz-tree-cell-text(lc-FF0000) {
  color: white !important;
}
#threadTree > treechildren::-moz-tree-row(lc-FF0000) {
  background-color: red !important;
}
#threadTree > treechildren::-moz-tree-cell-text(lc-FF0000, selected, focus) {
  color: red !important;
}
#threadTree > treechildren::-moz-tree-row(lc-FF0000, selected, focus) {
  background-color: transparent !important;
  border-width: 1px !important;
  border-style: dashed !important;
  border-color: black !important;
}
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

Re: disable highlighting of selected message

Post by chrizoo »

Many thanks for offering your help.
I don't see what your code is intended to do. I put it in userChrome.css and tried it out, but it seems to do something else.

Just a quick summary of my OP:
  • By default TB uses {background-color:blue} and {color:white} for selected messages.
    I want to disable this.
    I.e. NOT changing the colors of the selected message – NEITHER the background color, NOR the text color.

    I only want a border placed around the selected message (as a cursor). But everything within the border should stay as is.

    You can see this in the animation in my OP.
    It almost works, except for the pink eMail which turns black when selected. This is the problem I am looking to solve.
Post Reply