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 blurry FontImageSource icons in iOS Tab Bar and buttons #16864
Conversation
@jknaudt21 Can you point out any documentation that needs to be added? |
Not really. A lot of Maui.Platform doesn't get displayed in the docs (don't know why), so there's nothing here that stands out. That being said, you could always take the opportunity to document UpdateSourceAsync 😋 |
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.
Looks good to me! Aside from seeing if Windows should also receive the same fix (you already mentioned this in the comments), my only recommendation would be to add a test to check that that image's scale matches that of the IMauiContext. Not sure if that's even possible, but might we worth a try.
I think I also had a start with this, but no idea what state it is in: https://github.com/dotnet/maui/pull/14807/files One difference I see is that I used an optional window method, so I am wondering if there are situations where there is no window yet. Also, does this respond to density/scaling changes? Like on macOS you update the display scale? |
I don't think so, the We could still keep the code in place here That defaults to one if no windows is set though. Maybe it can log a warnings?
Not really sure how to achieve this right now. Image does this because we inherit from UIImageView but we can't inherit from UIButton. Perhaps we just need to wrap all our UIButtons so we can get life cycle events from them. |
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.
Looks OK generally, maybe some thoughts:
- we should probably avoid API shanges
- Maybe use the ubiquitous
GetDisplayDensity()
on all platform windows to get the density as it is a uniform API and supports windows' unique features.
@japarson you're still OK processing the feedback and taking this home? If not, please let us know so we can look at it! Thanks! |
Yep, working on it. Just had to wait for a couple PRs from Matt and Shane. |
c1347e7
to
b18fe34
Compare
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.
looks good.
Description of Change
We are not properly scaling the iOS icons:
The issue here is that on the first render, the Window is null, so we use a scale of 1 instead of e.g., 3. We can instead get the Window and scale through
MauiContext
. In the tab bar, we weren't using a scale at all.Issues Fixed
Fixes #6043
Fixes #14728