jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Option to use System Preference for Light/Dark Theme

Open dupontinquiries opened this issue 3 years ago • 3 comments

Is your suggestion for improvement related to a problem? Please describe.

I would appreciate a way to automatically apply either a light or dark theme whenever I switch my light/dark theme in my MacOS system preferences. Sometimes I am using an eink monitor and I prefer light themes because they are easier to read on eink IMO, and other times I am on an LCD panel monitor and do not want to hurt my eyes with a light mode (I want dark mode here).

Describe the solution you'd like

Could a radio button be added to the Appearance section of the settings dialog that says "Use System Default"?

Additional context

I would prefer a solution that does not require a program restart, but this may be easier or just a good first step to aim for.

Thank you to everyone who has contributed to this software!

dupontinquiries avatar Apr 26 '22 20:04 dupontinquiries

On Linux, it would be great if Jabref respected freedesktop.org's color scheme preference as well. It's universal across almost all Linux desktops now, so there should be no need to make the code specific to any one desktop or theme

ekirchman avatar Jul 23 '22 15:07 ekirchman

On Linux, it would be great if Jabref respected freedesktop.org's color scheme preference as well. It's universal across almost all Linux desktops now, so there should be no need to make the code specific to any one desktop or theme

I agree that JabRef should have Linux support, although I am not sure if this should be a separate ticket as my OP was about accessibility on MacOS.

dupontinquiries avatar Jul 25 '22 12:07 dupontinquiries

Needs to be done for each OS individually (as there is not yet a java/javafx API for doing this): Ideally using already existing tools see for example as an idea: ( https://gist.github.com/HanSolo/7cf10b86efff8ca2845bf5ec2dd0fe1d

Siedlerchr avatar Jul 25 '22 12:07 Siedlerchr

Hello, could I please be assigned to this issue? I'd like to make an attempt on it. Could someone please also let me know where would be the ideal place in the codebase to place the listener so that it can listen in the background for changes in MacOS System Preferences?

shafinkamal avatar Oct 17 '22 12:10 shafinkamal

@shafinkamal I would just check this once on startup or in the preferences. There needs to be an option to override the automatic detection

Siedlerchr avatar Oct 17 '22 12:10 Siedlerchr

Hi, I would like to take up this issue

aqurilla avatar Jun 13 '23 05:06 aqurilla

@aqurilla Thanks for your interest, there is already a good external library https://github.com/Dansoftowner/jSystemThemeDetector however, due to the method too large exception we could not integrate it :(

Siedlerchr avatar Jun 13 '23 06:06 Siedlerchr

Then let's remove this from "free to take" in good first issues and candidates for university projects for now.

ThiloteE avatar Jun 13 '23 09:06 ThiloteE

@Siedlerchr no problem, I'll try one of the other issues

aqurilla avatar Jun 14 '23 01:06 aqurilla

See https://github.com/HanSolo/JDKMon/blob/5602b03b36a12c66caf7793ab749520e9d2d5762/src/main/java/eu/hansolo/fx/jdkmon/tools/Detector.java#LL138C40-L138C41

calixtus avatar Jun 15 '23 20:06 calixtus

@calixtus It uses the Process cmd exec stuff while this one uses jna https://github.com/Dansoftowner/jSystemThemeDetector/blob/master/src/main/java/com/jthemedetecor/WindowsThemeDetector.java

Siedlerchr avatar Jun 15 '23 20:06 Siedlerchr

With the recent progress, the JDK issue shouldn't pose a problem anymore and we can use https://github.com/Dansoftowner/jSystemThemeDetector now. For anyone interested in working on this, the PR https://github.com/JabRef/jabref/pull/9263 might be a good starting point

tobiasdiez avatar Oct 16 '23 06:10 tobiasdiez

Hello, I have a university assignment right now. Can I give it a try?

EthanYifanJu avatar Oct 21 '23 08:10 EthanYifanJu