优化深色模式支持#5283
Merged
Merged
Conversation
Member
Glavo
commented
Jan 23, 2026
- 修复 macOS 上主题模式设置无法跟随系统设置的问题
- 在低版本 JavaFX 上支持跟随系统设置(目前仅支持 Windows/macOS,且仅在启动时检测一次,不会在运行中持续检测主题模式变化)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes dark mode support by fixing theme mode settings on macOS to follow system settings and adding fallback support for system theme detection on lower JavaFX versions (currently Windows/macOS only, detected once at startup).
Changes:
- Always show "auto", "light", and "dark" theme options in the UI regardless of JavaFX version
- Add fallback system theme detection for older JavaFX versions using native APIs (Windows registry and macOS defaults command)
- Set
apple.awt.application.appearanceto "system" on macOS to enable system theme following
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| HMCL/src/main/java/org/jackhuang/hmcl/ui/main/PersonalizationPage.java | Removed conditional logic that hid the "auto" theme option on older JavaFX versions, now always shows all three options |
| HMCL/src/main/java/org/jackhuang/hmcl/theme/Themes.java | Added getDefaultBrightness() method to detect system theme via Windows registry or macOS defaults command when JavaFX native support is unavailable |
| HMCL/src/main/java/org/jackhuang/hmcl/EntryPoint.java | Set apple.awt.application.appearance system property to "system" on macOS for proper AWT/Swing theme following |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.