style(settings): center the About section on the page

AboutInfoView (icon/name/version/links) now centers both
horizontally and vertically within the detail pane instead of sitting
pinned to the top-left like the other sections. Needed a GeometryReader
+ minHeight on the shared ScrollView wrapper — a ScrollView proposes
unbounded height to its content, so maxHeight: .infinity alone doesn't
give short content anything to center within; minHeight pinned to the
real viewport height does. Harmless for the other sections, which stay
top/leading-aligned as before.
This commit is contained in:
2026-08-15 01:35:24 +01:00
parent e2e4b746c1
commit 8d8c8fead8
+18 -6
View File
@@ -36,10 +36,21 @@ struct SettingsView: View {
} }
var body: some View { var body: some View {
ScrollView { // GeometryReader + `minHeight` (not `maxHeight`) is the actual fix for
sectionDetail // "center short content inside a ScrollView" a ScrollView proposes
.padding(28) // effectively unbounded height to its content, so `maxHeight: .infinity`
.frame(maxWidth: .infinity, alignment: .leading) // alone just resolves to the content's own intrinsic size and does
// nothing; forcing a `minHeight` equal to the real viewport height is
// what gives `aboutDetail`'s own centered alignment somewhere to
// actually center within. Harmless for the other (already
// top/leading-aligned) sections short ones just get blank space
// below, same as before.
GeometryReader { geometry in
ScrollView {
sectionDetail
.padding(28)
.frame(maxWidth: .infinity, minHeight: geometry.size.height, alignment: .leading)
}
} }
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.background) .background(.background)
@@ -340,11 +351,12 @@ struct SettingsView: View {
// MARK: - About // MARK: - About
private var aboutDetail: some View { private var aboutDetail: some View {
VStack(alignment: .leading, spacing: 16) { VStack(spacing: 16) {
sectionHeader sectionHeader
AboutInfoView() AboutInfoView()
.frame(maxWidth: 420, alignment: .leading) .frame(maxWidth: 420)
} }
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
} }
// MARK: - Helpers // MARK: - Helpers