kaikramer / keystore-explorer

KeyStore Explorer is a free GUI replacement for the Java command-line utilities keytool and jarsigner.
https://keystore-explorer.org/
GNU General Public License v3.0
1.67k stars 271 forks source link

Please consider picking up theme (light/dark) from OS preferences #401

Open carehart opened 1 year ago

carehart commented 1 year ago

Folks, very nice tool. Thanks very much. And it's nice also that you let us choose light or dark values for the theme ("look and feel", in your UI).

One small feature request about that, though: could you please consider picking up/using any theme (light/dark) as may be set as OS system preferences? I happen to be running on Windows, and have the dark theme set, so apps that detect that show dark without need to change them. I know that apps on Mac can do that as well.

Or even if not detected as the default, some apps do at least offer an option to choose to have it USE that OS preference (even if not picked up by default). And in fact in your UI for this (tools>preferences>user interface), there IS in fact such an option of "system" for the "Language" setting. There is no option with that value for "Look and Feel" above it.

Being able to at least select that would be an improvement, though again having that be the default might seem appropriate also.

Thanks for any consideration. I realize everyone's got an opinion! Sadly, not all of us have the skills to craft up a PR. :-)

kaikramer commented 1 year ago

There is currently no "native" way for a Java application to detect the OS settings for dark/light mode. However, there is a request for adding this feature to the JDK: https://bugs.openjdk.org/browse/JDK-8235460

And there is also a library that seems to use JNA to achieve this functionality: https://github.com/Dansoftowner/jSystemThemeDetector

The second option might be viable, especially since KSE is already using JNA, but don't expect any results in the near future. There are so many things to do for KSE right now with much higher priority than this...