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

Dark or light mode detection #2190

Open
marcelohdez opened this issue May 18, 2022 · 2 comments
Open

Dark or light mode detection #2190

marcelohdez opened this issue May 18, 2022 · 2 comments
Labels
enhancement adds or requests a new feature help wanted has no one working on it yet

Comments

@marcelohdez
Copy link

Hello, is there any way to detect light or dark mode on the system an application is running on to change themes respectively?

After looking for a while I can't find any mention of it in Druid, and no Druid example seems to adhere to the dark/light mode setting (at least on MacOS) despite its theme containing keys for dark and light colors?

Should I just rely on the dark-light crate for now and check periodically?

Screen Shot 2022-05-18 at 10 48 09 AM

@xStrom xStrom added enhancement adds or requests a new feature help wanted has no one working on it yet labels Jun 2, 2022
@xStrom
Copy link
Member

xStrom commented Jun 2, 2022

Druid does not currently provide this information. It is something that we want to support automatically in the future, including detecting live changes to this setting. Generally speaking the whole environment/theme story of Druid needs a lot of improvements. I think some changes are coming soon™ to the environment with the Xilem rework.

For now using that dark-light crate is a decent middle step.

Let's keep this issue open here to track the status of this feature in Druid.

@xStrom
Copy link
Member

xStrom commented Jun 29, 2022

#2196 and #2204 made some first steps in implementing the dark/light detection for Windows in druid-shell. It's done once though and is not really reactive to runtime changes, nor does it expose this to druid apps themselves. That work remains to be done in the future.

Those issues also mention the potential of adding a dependency to windows-rs to get better access to this information. Other options might include WM_THEMECHANGED, WM_SYSCOLORCHANGE, and RegNotifyChangeKeyValue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement adds or requests a new feature help wanted has no one working on it yet
Projects
None yet
Development

No branches or pull requests

2 participants