jeevatkm/ReplyWithHeaderMozilla

RWH uses black txt for header when using Win10 dark mode.

jmc8 opened this issue · 12 comments

jmc8 commented

When using Win 10 dark mode from the Settings->Colors menu, RWH still uses black text for the header, which is nearly impossible to see when viewed against the dark grey background used by Thunderbird.
Thunderbird itself changes the email body txt color from black to white when using win 10 dark mode.

I would expect RWH to use either the same color txt Thunderbird is using or to use white color text when using dark mode.

I can confirm this. This also applies to dark mode on Linux (xfce).

If RWH would not explicitly specify a font color, the default color based on the theme would be used.
@jeevatkm Do you have plans to change this?

jmc8 commented

@cnmicha @jeevatkm
I'm a firmware engineer, not a js/chrome/html engineer, so I'm easily wrong here.
Based on cnmicha's comments, this line should be commented out:
ReplyWithHeaderMozill/defaults/preferences/rwf-defaults.js, line 23:
https://github.com/jeevatkm/ReplyWithHeaderMozilla/blob/master/defaults/preferences/rwh-defaults.js

How would I test that?

@jmc8 I think commenting out line 23 just removes the default value of the preference. However, this does not stop the HTML color tag from being added to the email message (although it would have no value, but that doesn't comply with the HTML syntax).

I see two options:
a) remove the color setting and the corresponding HTML tag that is being added completely. Of course, this removes some functionality from the add-on. Do we want to do this?
b) add a checkbox in the preferences ("use theme default color"). If activated, the font color HTML tag will not be added and the value of the color code setting will be ignored.

Personally, I prefer option b) as it does not remove functionality. I will try to provide a pull request in the next few days if @jeevatkm woud be willing to merge it.

An easy way to try out a change is to download the .xpi file from the add-ons website, unzip it (it's just a .zip file with another extension), do the change, zip it again, change the extension to .xpi, open the add-ons window in Thunderbird. Then you can click on the small gear icon and select "install from file".

@cnmicha I have read the thread.
Currently, I do not how to grab the theme color value or TB-provided color value. I have to read the TB documentation for it.

If you know the answer, please feel free to create a PR.

For the ones who wish to test alt a) described above, just edit line 366 in \chrome\content\core.js

Replace (with the help of 7-zip):

let htmlTagPrefix = '<div style="font-family:' + fontFace + ' !important; color:'
        + fontColor + ' !important; font-size:' + fontSize + fontSizeUnit + ' !important;">';

With:
let htmlTagPrefix = '<div style="font-family:' + fontFace + ' !important; font-size:' + fontSize + fontSizeUnit + ' !important;">';

jmc8 commented

I would test out Fredrik-69's suggested fix, however RWH is currently not working on Thunderbird v102. Damn Thunderbird. Why do they constantly break everyone's plug-ins? In my line of work, doing so will get you fired.

I would test out Fredrik-69's suggested fix, however RWH is currently not working on Thunderbird v102. Damn Thunderbird. Why do they constantly break everyone's plug-ins? In my line of work, doing so will get you fired.

While editing the source code, just replace 91.* with 102.* in manifest.json. Voilà!

If you're interested I have prepared such a file for version 102.* and with font color removed. I have put version 2.4.1 on it.
Use it if you like. Just rename from .zip to .xpi since it doesn't seem allowed to upload xpi files here.

replywithheader-2.4.1-tb.zip

jmc8 commented

Fredrik-69, you are awesome! Everything works as expected.
Thank You!

@Fredrik-69, I think I've made the appropriate change to line 366 of the current version of the extension (2.5). But the paragraph formatting in replies now differs from new emails. In a reply, the style shows as "Paragraph," but the behavior is as if "Body Text" is being used (i.e., no blank lines between paragraphs as when "Use Paragraph format instead of Body Text by default" is checked for newly composed emails.

Would you have any suggestions about modifications to the code that should be swapped out in line 366 to avoid this effect?

Thanks so much for your thoughts!

@dstark, sorry but I don't have any solution.
Personally I don't understand why anyone wants the paragraph behavior. It's the fist thing I change in a new install of Thunderbird/Betterbird. Paragraph formatting is against all non-written email rules and should not be used if you ask me.