Hi, as you can see in the screenshot below, currently Mailspring displays a white tray icon even in light themes:
Using KDE Neon Developer Edition Unstable.
Proposed Solution
So I was wondering if it would be possible to make mailspring recognize the theme in use and display the correct tray icon (in this case, a dark one), though I think that snap confinement wouldn’t allow that. Maybe implementing a switch from which you can manually set the correct tray icon is more feasible, what do you think?
Hey! Ahh this would be super cool - do you know how KDE normally exposes the theme tint color / light vs dark setting? I know we get a few environment variables through the Snap daemon, so we might be able to do this if it’s one of them.
Hey! Ahh this would be super cool - do you know how KDE normally exposes the theme tint color / light vs dark setting? I know we get a few environment variables through the Snap daemon, so we might be able to do this if it’s one of them.
Plasma doesn’t distinguish between light and dark themes, there’s just colour schemes.
You can read ~/.config/kdeglobals to get the colour palette of the active colourscheme.
This still hasn’t been fixed, I get a white icon on light background using KDE Plasma with Breeze theme. Perhaps a custom fix could be made when it detects “Breeze” (but not “Breeze Dark”) as the theme, as many users will be using it as its the default in Manjaro etc.
Could you make a dark version of the tray icon for light desktop color schemes and put it on a switch in the preferences? It’s currently invisible with my light color scheme on Xfce.
Notice the Mailspring icon, which is barely visible against the white background.
Can you add an option for light-colored panels such as mine? By selecting this option you would be able to toggle the icon color, which would go from white to black.
I have a fork of Mailspring that sports a dark black icon, the problem is that since version 1.10.2 the version I build on my Linux box does not work properly (not even the standard Mailspring), and I don’t have time to fix it. Anyway, if you want to try and build it, you can “git clone” the repository here:
enter the Mailspring directory it and run
npm install
npm run-script build
to produce deb and rpm packages.
How do you detect if the theme is light or dark? Each Linux desktop may or may not support this feature, and they would all use different ways. Also, the theme lightness does not necessarily reflect the actual color of the systray. There is a dark-mode electron package that seems to support MacOSX, but not linux.
What would work, is provide an SVG icon, that can be colorized by the theme engine. Or an icon that can be themed. However, Mailspring uses the “Nativeimage” electron package, which only supports PNG images.
The last option would be to add a setting option, or an extension, to change this icon. But this is way above my skills with electron (I program scientific software in Fortran for a living!)
Anyway, I’ll go back to it eventually. I have not been able to have electron nativeTheme return anything useful, but it maybe just me making some silly mistake. On the other hand, today I found out that if I provide a mostly monochrome dark icon even in png, KDE seems to be able to invert it on its own when selecting a dark theme. I don’t know if gnome can do the same.
Seems like I did finally get it to work in the last b2 of my patch, but… It is not supported by electron due to upstream bugs until very recently, for sure not the version 14.3 used to build it. I leave the code there for the moment, will come back to it in the future https://github.com/microsoft/vscode/issues/91169
@paulatz it is worth opening a PR on mailspring with prefix “WIP:” with your modification and let the maintainers know how it is progressing, so they can help you with the best way to implement it.