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

egui-winit: Automatically detect and apply dark or light mode #1045

Merged
merged 2 commits into from
Feb 2, 2022

Conversation

emilk
Copy link
Owner

@emilk emilk commented Jan 6, 2022

Closes #1001

Uses the dark-light crate: https://crates.io/crates/dark-light

@emilk
Copy link
Owner Author

emilk commented Jan 6, 2022

Oh, dark-light doesn't even compile on Linux yet… I guess we'll wait with this until frewsxcv/rust-dark-light#4 by @edfloreshz is merged and published

@emilk
Copy link
Owner Author

emilk commented Jan 6, 2022

Blocked on:

@parasyte
Copy link
Contributor

parasyte commented Jan 6, 2022

Unfortunately, I think you'll also want frewsxcv/rust-dark-light#3

@emilk
Copy link
Owner Author

emilk commented Jan 6, 2022

We want frewsxcv/rust-dark-light#3 but it is not needed in order to merge this

@parasyte
Copy link
Contributor

parasyte commented Jan 6, 2022

I suppose polling for changes is acceptable in the meantime.

@Be-ing
Copy link

Be-ing commented Jan 6, 2022

Is there an advantage to egui-winit doing this versus leaving applications to use dark-light if they want?

@emilk
Copy link
Owner Author

emilk commented Jan 17, 2022

Is there an advantage to egui-winit doing this versus leaving applications to use dark-light if they want?

One is to have a default: should egui be dark or light by default? Let's ask the system.
Second is convenience.

If the dark-light adds too much compile-time we should make it an optional feature though.

@emilk emilk merged commit c3be566 into master Feb 2, 2022
@emilk emilk deleted the auto-dark-mode branch February 2, 2022 16:09
@collin-kemper
Copy link
Contributor

collin-kemper commented Mar 30, 2022

dark-light currently breaks eframe on my machine. dark_light::detect() times out on my machine but takes 25 seconds to do so - meaning that starting an eframe app results in it freezing for the first 25 seconds. I've tried to disable the feature, but it doesn't seem like it is possible to disable it.

Now solved in PR #1437

@emilk
Copy link
Owner Author

emilk commented Mar 30, 2022

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.

eframe: Figure out dark mode preference on native
4 participants