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

Fix the animated icon foreground. #4646

Merged
merged 2 commits into from
May 3, 2021

Conversation

StephenLPeters
Copy link
Contributor

Before this change AnimatedIcon would respond to its foreground property changing to a new value, but it would not respond to its foreground property mutating. Because the foreground brush isn't actually used, but instead we pass the color property from it (if its a solid color brush) to the composition visuals, we actually need to be informed when the color property changes, so now we attach a handler to that property changed event.

There is still an issue however. Foreground is a propagating property, meaning that if foreground isn't set on AnimatedIcon directly, the system will use the foreground of the nearest ancestor with the property set. The system will raise a property changed notification to animated icon when the foreground property changes, but not when it mutates. So, even with this change, we wont respond when using an ancestors foreground and the color within that foreground changes. If anyone has an idea about how to fix this I'm all ears!

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 24, 2021
@StephenLPeters
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephenLPeters
Copy link
Contributor Author

@chingucoding fyi

@StephenLPeters StephenLPeters added area-AnimatedIcon team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Mar 24, 2021
@marcelwgn
Copy link
Collaborator

Huh interesting that this happens. Thanks for pinging me on this @StephenLPeters !

Regarding the second case, shouldn't we be able to listen to the changes of that brush too? Or does the AnimIcon not know the foreground if it get's propagated during the initial rendering? If the initial pass fails, could we just walk up to the tree to get the correct value?

@StephenLPeters
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephenLPeters StephenLPeters merged commit aca8c13 into main May 3, 2021
@StephenLPeters StephenLPeters deleted the user/stpete/AnimatedIconForeground branch May 3, 2021 22:00
@ghost
Copy link

ghost commented Jun 24, 2021

🎉Microsoft.UI.Xaml v2.6.0-prerelease.210623001 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-AnimatedIcon team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants