Automatically adjust colors depending on operating system theme #1022
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.
This PR allows Sioyek to automatically adjust the color mode (dark/light) depending on the operating system theme.
Uses a configuration option
use_system_theme
to enable it. I made it so that ifuse_system_theme
is setdefault_dark_mode
is not used but I suppose that's up for debate.NOTE: I've only tested the code on MacOS but it uses
QEvent::ThemeChange
(available in Qt 6.5.0 and above) so it should be portable to other operating system. I don't have access to another machine so I'm unable to test currently.This is stacked on #1021 (#1021 should be merged first - then I can rebase this PR)
Screen.Recording.2024-03-24.at.23.17.50-2.mp4