-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Get prefers color scheme from accountsservice #319
Conversation
I think we'll want to switch this to an enum since elementary/default-settings#166 was merged. |
@cassidyjames Updated. This should work with the new accountsservice stuff. Since there's no system UI for this yet, you can send this in dfeet I guess there's a question of how should we demo this? I think we want the override here for the demo maybe? Or should we remove that toggle? Also, we currently only include this for accountsservice in Odin. Should we add this in Hera too? Maybe not necessarily exposing the setting yet, but if it exists in Granite and AccountsService we could start testing it Is it okay to make this a boolean property or should we make this enum out of the box? The boolean is nice because you can super easily bind this to app-prefers-dark right now. But this doesn't account for any prefers-light. I guess if we decide to support that we can come back and deprecate the boolean property? |
I think we default to the user preference but still allow a local override (so devs can still test how widgets look without changing their whole system preference)? But we can think about it. Another option would be to implement what we expect to see in apps like Code or Terminal where we might want to allow for a tri-state of light/dark/follow system.
Yeah I think we include it in Hera. I think I'd like to ship the system UI stuff for 5.2 if possible, because it has been a long time coming and would be a nice preview of the bigger dark style stuff for 6.0.
Yeah I think boolean is fine and we can deprecate later if/when we expose a light preference. |
Hmm, I guess this raises the question of how apps should bind to it. If it changes live, I imagine we'd want the app to change instantly, too. But if they offer an override, how does that interact? I think that's where it has to become a tri-state of:
Which is similar to what I see in Android apps fwiw. I think most apps that support a dark style should just automatically follow along with the setting and not offer up any sort of UI for it, though. |
I guess I'm fine in general with this as a starting point, we can always iterate. I would like to get a review of the code side from someone more familiar and opinionated about Granite and namespacing and everything, though. |
It would probably make it clearer indeed to return an enum instead of having a boolean, that way we can extend it without fearing API breaks |
Co-Authored-By: Corentin Noël <corentin@elementary.io>
@tintou see: elementary/default-settings#167 (comment) We should decide on unsigned or signed and then make sure it matches in the master and hera branches of default-settings as well as here. Edit:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as advertised. Thanks for hooking up the changes as well to demo how apps can do that!
Create a Granite.Settings class like Gtk.Settings. Fixes #276
Read-only is intentional as we don't want apps setting this for the user