Reapply #1929 and fix issue where header title uses incorrect font #2040
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Platforms Impacted
Description of changes
Issue:
#1929 ensured that the
TableViewHeaderFooterView
does not override any font or color provided as part of the AttributedString. However, an issue was observed where headers that should beheaderPrimary
are showing up asheader
and vice versa. The change was reverted in #1945.We were also seeing an issue where the title font would change after scroll where the title goes off screen.
This change reapplies #1929 and fixes the issue where headers that should be
headerPrimary
are showing up asheader
and vice versa, as well as the issue where the title font changes after it goes off screen.Root Cause:
resolvedTitleFont
andresolvedTitleColor
were only set once at insidesetup(...)
. This call occurs before thetokenSet
is updated with overrides and theresolvedTitleFont
would be set to the wrong font as a result.dequeueReusableHeaderFooterView
was called, soresolvedTitleFont
andresolvedTitleColor
properties were still set in some cases and the values would be used when rendering the header for a different header with a different font.Fix:
resolvedTitleFont
andresolvedTitleColor
toattributedTitleFont
andattributedTitleColor
as they'll only be used to hold values for the attributed string.resolvedTitleFont
andresolvedTitleColor
as an r-value withattributedTitleFont ?? tokenSet[.textFont].uiFont
andattributedTitleColor ?? tokenSet[.textColor].uiColor
.setupBase(...)
with their parameters.setupBase
handles the cleanup and ensures all the properties are set in the same order for call cases.Binary change
Total increase: 19,968 bytes
Total decrease: -808 bytes
Full breakdown
Verification
TableViewHeaderFooterSampleData
After
category of this Revert #1929 #1945Visual Verification
Before
upstream.main.head.mov
After
feature.head.mov
Pull request checklist
This PR has considered:
Microsoft Reviewers: Open in CodeFlow