Align button areas to consistent width across SegmentedRowView rows#1208
Open
timbms wants to merge 1 commit into
Open
Align button areas to consistent width across SegmentedRowView rows#1208timbms wants to merge 1 commit into
timbms wants to merge 1 commit into
Conversation
Segmented, press-release and single-mapping button areas on the same page previously had different widths depending on label content. Introduce a PreferenceKey/EnvironmentKey pair so each page collects the maximum natural button-area width and feeds it back to every row via `alignSegmentedButtonAreas()` on the List. Each button area reports its natural width and is then sized to the page-wide maximum using an exact frame, keeping all controls trailing-aligned and within row bounds. Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
SegmentedButtonAreaWidthKey(PreferenceKey, max-reduce) andsegmentedButtonAreaMaxWidth(@Entryenvironment value) to propagate the page-wide maximum button-area widthalignSegmentedButtonAreas()on theListinSitemapPageView(andPreviewList) wiresonPreferenceChange→environmentbuttonAreaWidth()on each button-area type measures natural width via aGeometryReaderbackground and applies an exactframe(width: maxWidth, alignment: .trailing)once the page-wide max is known — all three button types (segmented, press-release, single-mapping) share the same frame width and stay trailing-aligned within itTest plan