From 6ebcc162e63066ac512efb120ad531d2ff67fc13 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 16 Apr 2023 14:12:27 -0400 Subject: [PATCH] Add icons to About screen links --- .../Screens/Preferences/About/AboutView.swift | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Tusker/Screens/Preferences/About/AboutView.swift b/Tusker/Screens/Preferences/About/AboutView.swift index f2b38f0b..d9c8172b 100644 --- a/Tusker/Screens/Preferences/About/AboutView.swift +++ b/Tusker/Screens/Preferences/About/AboutView.swift @@ -45,7 +45,9 @@ struct AboutView: View { .appGroupedListRowBackground() Section { - Link("Website", destination: URL(string: "https://vaccor.space/tusker")!) + Link(destination: URL(string: "https://vaccor.space/tusker")!) { + Label("Website", systemImage: "safari") + } Button { if MFMailComposeViewController.canSendMail() { Task { @@ -56,7 +58,7 @@ struct AboutView: View { } } label: { HStack { - Text("Get Support") + Label("Get Support", systemImage: "envelope") Spacer() if isGettingLogData { ProgressView() @@ -65,9 +67,14 @@ struct AboutView: View { } } .disabled(isGettingLogData) - Link("Source Code", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker")!) - Link("Issue Tracker", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker/issues")!) + Link(destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker")!) { + Label("Source Code", systemImage: "curlybraces") + } + Link(destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker/issues")!) { + Label("Issue Tracker", systemImage: "checklist") + } } + .labelStyle(AboutLinksLabelStyle()) .appGroupedListRowBackground() } .listStyle(.insetGrouped) @@ -166,6 +173,15 @@ private struct MailSheet: UIViewControllerRepresentable { } } +private struct AboutLinksLabelStyle: LabelStyle { + func makeBody(configuration: Configuration) -> some View { + HStack(alignment: .lastTextBaseline, spacing: 8) { + configuration.icon + configuration.title + } + } +} + struct AboutView_Previews: PreviewProvider { static var previews: some View { AboutView()