-
Notifications
You must be signed in to change notification settings - Fork 693
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
[NavigationView] Fix centering of NVI labels a bit using bottom padding #5187
[NavigationView] Fix centering of NVI labels a bit using bottom padding #5187
Conversation
Is this change needed with Segoe UI Variable Small? Also I think this kind of cantering happens with the buttons. |
I would say "probably yes" since I don't think that the font would be much different compared to Segoe UI. Of course this fix is not ideal, however I am not sure how else we can address this, TextBlock just occupies more space on the top than it should. Properties like TextAlignment or LineHeight don't make any difference here from my experiments. |
It does have a greater x-height |
That's really interesting. So if we switch to Segoe UI Variable Small, we would need to update the value again then. Makes me questions if there is a better way to solve this. |
This may have to be one of those things that is put under a version number conditional. The new Variable font is there in the current Insider Builds, but I have no idea if Windows 10 21H2 will get it, or if it will only be used with Windows 11/Sun Valley being announced on June 24th. If it is to apply to all WinUI 2 and 3 apps, then does it get packaged with WinUI? Or does it rely on an OS update for all supported version, or only Vibranium builds, so 20H2 onwards? |
That's a really good question, I would argue though that it is desirable to have this be part of WinUI 3, otherwise this would introduce platform conditionals, something which is one of the things WinUI 3 wanted to eliminate. |
I would hold off on this, until there is some certainty on how fonts will be handled. The use of the Optical Size axis to switch between Small, Text, and Display variations, would seem to be tied to the font sizing used. You can see the Headings in Your Phone are using a Semibold Display font but the Live Tiles are using the Small font variant. Text variants seem to look almost identical to Segoe UI - so will Small only apply below 14pt text? Are these to be handled by Xaml Resources, or does the Optical Size value get applied selectively. This is something that may need input from the design team, so @chigy and the control owner @karenbtlai I think it is. |
Isn't that top padding accounted for accented character like � So if you put  next to Setting you wouldn't find the top padding unused - the top caret uses that. Could you please test that with this PR, whether  would appear as not center-aligned? In general, adjusting text alignment based on one language would certainly break the layout for other languages. |
@roxk Is correct, the spacing is for accents. Below is a screenshot of how it would look with an accented character: |
@jevansaks and @licanhua FYI about fonts. |
@chigy to confirm this has been talked about with design. |
Not quite sure what this is asking but if this is asking if we account for ascenders and descenders for our design, then yes. |
@chigy The ask is about whether the "Settings" text needs some adjustment for vertical centering, and I asked if the change in font with Segoe UI Variable will affect this alignment. |
The text being off centered is due to the Segoe UI font being 1px lower. The more logical fix is to adjust A bottom padding of 3px on NVI is too high up, and clutters the template. |
Removed the padding now and updated the margin as you suggested @karenbtlai . Here is a screenshot of the current state (with accented A): |
Thank you @mdtauk for summery. It helps. |
Segoe UI Variable in the insider build is v1.03 but in what may or may not have leaked as Windows 11, it seems to be v2.0 so maybe that version is different. But if centering it is recommended, I'm sure @chingucoding will get out done superbly |
What does "Top is where it is today" mean? Today as in today on the main branch or as in today in this PR? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@chingucoding can you update the verification files? Also let me get some design eyes on it to make sure the text alignment is correct. |
Updated the verification files now @karenbtlai :) |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
I was trying to update the verification files, however it fails with the following errors:
Not sure why this happens, maybe this was due to the switch to a different build pool? |
@chingucoding cam you merge up to date main? I will kick off the pipeline after that |
@beervoley Branch is up to date now :) |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@chingucoding Looks like there are new conflicts. Would you be able to resolve them? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
This reverts commit 168daee.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
Since the text is not vertically centered inside a TextBlock but rather has a bit of top padding (even with padding set to 0), we need to adjust this by adding a bit of bottom padding.
Motivation and Context
Closes #5076
How Has This Been Tested?
Tested manually, see screenshot.
Screenshots (if appropriate):