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

Leverage EventChannel to listen for the system accent color #243

Open
GroovinChip opened this issue May 11, 2022 · 4 comments
Open

Leverage EventChannel to listen for the system accent color #243

GroovinChip opened this issue May 11, 2022 · 4 comments
Labels
help wanted Extra attention is needed theme

Comments

@GroovinChip
Copy link
Collaborator

Currently, we are hardcoding the bizarrely-named MacosColors.controlAccentColor, which is the user's selected system accent color. (Obviously this name doesn't make much sense, but that's what Apple calls it...).

Obviously, someone making a macOS application would expect that their choice of system-level accent color would be reflected in their application unless explicitly overridden. Since macos_ui is now a plugin, we can leverage Flutter's EventChannel to listen to the native controlAccentColor's value.

This would require some refactoring to MacosColors since controlAccentColor is a static value. I'm not quite certain the best way to proceed with this at this time.

@GroovinChip GroovinChip added enhancement help wanted Extra attention is needed theme labels May 11, 2022
@whiplashoo
Copy link
Collaborator

Could this be of any help?

@whiplashoo
Copy link
Collaborator

Also, a more complete way of getting the accent color.

@GroovinChip
Copy link
Collaborator Author

GroovinChip commented Jul 9, 2022

Also, a more complete way of getting the accent color.

Okay, I have done a first pass on this feature via the code found above. It should be noted that this is done through MethodChannel, though, not EventChannel. I tried doing that and I kept getting null back for the color. See this gist for more on that attempt.

This code is available to browse in the accent_color_listener branch

@GroovinChip
Copy link
Collaborator Author

@Adrian-Samoticha this is relevant to our accuracy work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed theme
Projects
Status: In Discovery
Development

No branches or pull requests

2 participants