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 IconTintColorBehavior not tinting UriImageSource and TintColor binding not working on Windows #1929

Closed
wants to merge 3 commits into from

Conversation

myix765
Copy link
Contributor

@myix765 myix765 commented Jun 12, 2024

Description of Change

On Windows, the IconTintColorBehavior did not tint images with a URL source and in the CommunityToolkit sample, the ImageButton with the TintColor binding was not changing color when pressed. These issues did not happen on Mac or iOS. The issue was with the OnImageOpened() function not getting called with for URL images. There was a change made in a previous pull request #1370 that fixed an issue described in #1333 on Windows where applying the IconTintColorBehavior caused the image to not show up, but when reverting this change, the URL image was tinted correctly and the ImageButton worked. Reverting the change did not cause the issue in #1333 to reappear.

Below is an image of the tests I wrote in the sample solution to see the change:
image

This is what it looks like without the change:
image

Linked Issues

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional Information

Tested on Windows 10

@myix765
Copy link
Contributor Author

myix765 commented Jun 12, 2024

@dotnet-policy-service agree

Copy link
Collaborator

@brminnick brminnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @myix765! This update introduces a new bug where the image is not properly updated. Please look into this and ensure it is resolved before we can merge this PR.

Here's a screen recording of CommunityToolkit.Maui.Sample showing two new bugs:

  1. The tinted image (red shield with checkmark) does not disappear when the dotnet bot is displayed
  2. The red tinted imageimage does not properly overlay the original black tinted shield image when the dotnet bot is not displayed
    • Look closely and you'll see a red shield and a black shield image on the screen
    • The red shield should perfectly overlay the black shield image

ScreenFlow

For reference, here is a screen capture showing it working properly on iOS:

Simulator Screen Recording - iPhone 15 Pro - 2024-06-14 at 15 33 31

@myix765
Copy link
Contributor Author

myix765 commented Jun 18, 2024

@brminnick Sorry about that, I neglected to verify that the other ImageButton still works. I made a change that only fixes Issue #1906 so I will close this pull request and make a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants