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

Automatically adjust colors depending on operating system theme #1022

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

isaksamsten
Copy link

@isaksamsten isaksamsten commented Mar 24, 2024

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 if use_system_theme is set default_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

- remove unused code
- correctly indent the code with 4 spaces.
Automatically toggle between dark and light mode depending on the
desired mode from the operating system.

Introduces a new config option `use_system_theme` which if set
automatically set light or dark mode when starting depending on if the
current operating system theme is in light or dark mode. Then, if the
operating system mode changes, the change is reflected in Sioyek.
@ahrm ahrm merged commit d091b0a into ahrm:development Mar 26, 2024
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants