Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use System preference for light dark theme #10593

Merged
merged 12 commits into from
Nov 9, 2023

Conversation

EthanYifanJu
Copy link
Contributor

Resolve #8729
Based on the work of #9263

In the Preference -> General -> Appearance -> Visual Theme drop-down list, I added one more option called "Use System Preference", which will change between light/dark themes according to current OS system settings. jSystemThemeDetector is used to achieve this goal.

Screenshot 2023-10-28 at 12 29 26

Manually test the outcome on the MacOS. As expected, the theme will change according to the Mac appearance setting.

Screen.Recording.2023-10-28.at.12.38.01.mov

Manually test the outcome on the Windows. As expected, the theme will change according to the Windows Colour setting (Sorry I can't change the language into English for this Windows device. The three options are Light/Dark/Custom in the drop-down list). This device is relatively old, so I assume the delay is normal when changing themes.

video1845810326.mp4

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

EthanYifanJu and others added 7 commits October 24, 2023 03:48
- Add "Use System Preference" option under General -> Appearance -> Visual Theme
- Add flags to store whether user chose this option
- Add SystemThemeDetector.java for auto detect system theme(to do)
- Add jSystemThemeDetector dependency in build.gradle
- Implemented detector into codebase
- Delete unnecessary java file
@Siedlerchr Siedlerchr changed the title Fix for issue #8729 Use System preference for light dark theme Oct 28, 2023
koppor
koppor previously requested changes Oct 28, 2023
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some code comments

When I keep "Light", but set in Windows to "Dark", JabRef also gets dark

image

build.gradle Outdated Show resolved Hide resolved
licenses/com.jthemedetector.OsThemeDetector Outdated Show resolved Hide resolved
src/main/java/org/jabref/gui/JabRefGUI.java Outdated Show resolved Hide resolved
src/main/java/org/jabref/gui/JabRefGUI.java Outdated Show resolved Hide resolved
src/main/java/org/jabref/gui/JabRefGUI.java Outdated Show resolved Hide resolved
@calixtus
Copy link
Member

calixtus commented Nov 9, 2023

I put some work into this.
grafik
grafik

@calixtus calixtus added this pull request to the merge queue Nov 9, 2023
Merged via the queue into JabRef:main with commit 2b0eaae Nov 9, 2023
17 of 18 checks passed
Siedlerchr added a commit to xuanan20020/jabref that referenced this pull request Nov 10, 2023
* upstream/main: (24 commits)
  Add support for scite.ai (JabRef#10617)
  Update tests.yml (JabRef#10631)
  replace "SearchAll" in web search by "Search Selected" (JabRef#10611)
  Use System preference for light dark theme (JabRef#10593)
  Fix NPE in lookup identifer
  Add minimum requirements to CHANGELOG.md (JabRef#10628)
  Update to JavaFX 21.01 (JabRef#10627)
  Fix JabRef#10498 Create Fetcher and Transformer for ScholarArchive (JabRef#10549)
  fix tests
  Bump org.jsoup:jsoup from 1.16.1 to 1.16.2 (JabRef#10625)
  Bump org.junit.jupiter:junit-jupiter from 5.10.0 to 5.10.1
  Bump org.fxmisc.flowless:flowless from 0.7.1 to 0.7.2
  Bump com.dlsc.gemsfx:gemsfx from 1.84.0 to 1.90.0
  Bump com.tngtech.archunit:archunit-junit5-api from 1.1.0 to 1.2.0
  Change linter (JabRef#10614)
  change codecov (JabRef#10616)
  Add entry based on ISSN number JabRef#10124 (JabRef#10178)
  Enable journal information fetcher directly in popup (JabRef#10598)
  Make generate button wider (JabRef#10588)
  make openRewrite stable again
  ...

# Conflicts:
#	CHANGELOG.md
#	src/main/resources/l10n/JabRef_en.properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to use System Preference for Light/Dark Theme (Win/Lin/OSX)
5 participants