From 8d8c8fead8064d6f95a46e242b7852a03789870c Mon Sep 17 00:00:00 2001 From: psavarmattas Date: Sat, 15 Aug 2026 01:35:24 +0100 Subject: [PATCH] style(settings): center the About section on the page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Outpost/Features/Account/SettingsView.swift | 24 +++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Outpost/Features/Account/SettingsView.swift b/Outpost/Features/Account/SettingsView.swift index a61804d..228d86b 100644 --- a/Outpost/Features/Account/SettingsView.swift +++ b/Outpost/Features/Account/SettingsView.swift @@ -36,10 +36,21 @@ struct SettingsView: View { } var body: some View { - ScrollView { - sectionDetail - .padding(28) - .frame(maxWidth: .infinity, alignment: .leading) + // GeometryReader + `minHeight` (not `maxHeight`) is the actual fix for + // "center short content inside a ScrollView" — a ScrollView proposes + // effectively unbounded height to its content, so `maxHeight: .infinity` + // 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) .background(.background) @@ -340,11 +351,12 @@ struct SettingsView: View { // MARK: - About private var aboutDetail: some View { - VStack(alignment: .leading, spacing: 16) { + VStack(spacing: 16) { sectionHeader AboutInfoView() - .frame(maxWidth: 420, alignment: .leading) + .frame(maxWidth: 420) } + .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) } // MARK: - Helpers