improve settings UI + find wallpapers on home page

This commit is contained in:
leminlimez committed 2025-06-03 14:57:16 -04:00
1 parent b0db8da590
commit dcd368817d
2 files changed
+25 -20

No files matched your search

+7
View File
@@ -106,6 +106,13 @@ struct ContentView: View {
.padding() .padding()
.navigationTitle("Pocket Poster") .navigationTitle("Pocket Poster")
.toolbar { .toolbar {
ToolbarItem(placement: .topBarLeading) {
if let wpURL = URL(string: PosterBoardManager.WallpapersURL) {
Link(destination: wpURL) {
Image(systemName: "safari")
}
}
}
ToolbarItem(placement: .topBarTrailing, content: { ToolbarItem(placement: .topBarTrailing, content: {
NavigationLink(destination: { NavigationLink(destination: {
SettingsView() SettingsView()
+18 -20
View File
@@ -19,14 +19,15 @@ struct SettingsView: View {
@State var errorAlertDescr: String? @State var errorAlertDescr: String?
var body: some View { var body: some View {
ScrollView { List {
Section { Section {
VStack {
TextField("Enter App Hash", text: $pbHash)
.textFieldStyle(RoundedBorderTextFieldStyle())
.font(.system(.body, design: .monospaced))
HStack { HStack {
// Add button to run task to check until file exists from Nugget pc over AFC
Text("App Hash:")
.font(.headline)
.foregroundColor(.primary)
Spacer() Spacer()
// Run task to check until file exists from Nugget pc over AFC
Button(action: { Button(action: {
UIApplication.shared.confirmAlert(title: "Waiting for app hash...", body: "Connect your device to Nugget and click the \"Pocket Poster Helper\" button.", confirmTitle: "Cancel", onOK: { UIApplication.shared.confirmAlert(title: "Waiting for app hash...", body: "Connect your device to Nugget and click the \"Pocket Poster Helper\" button.", confirmTitle: "Cancel", onOK: {
cancelWaitForHash() cancelWaitForHash()
@@ -35,19 +36,18 @@ struct SettingsView: View {
}) { }) {
Text("Detect") Text("Detect")
} }
.buttonStyle(TintedButton(color: .green, fullwidth: false)) .foregroundStyle(.green)
.onChange(of: checkingForHash) { .onChange(of: checkingForHash) {
if !checkingForHash { if !checkingForHash {
// hide ui // hide ui alert
UIApplication.shared.dismissAlert(animated: true) UIApplication.shared.dismissAlert(animated: true)
} }
} }
} }
TextField("Enter App Hash", text: $pbHash)
.textFieldStyle(RoundedBorderTextFieldStyle())
.font(.system(.body, design: .monospaced))
} }
.padding(.bottom, 5) } header: {
Label("App Hash", systemImage: "lock.app.dashed")
}
Section { Section {
Button(action: { Button(action: {
@@ -56,7 +56,6 @@ struct SettingsView: View {
}) { }) {
Text("Replay Tutorial") Text("Replay Tutorial")
} }
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
Button(action: { Button(action: {
UIImpactFeedbackGenerator(style: .soft).impactOccurred() UIImpactFeedbackGenerator(style: .soft).impactOccurred()
@@ -75,31 +74,30 @@ struct SettingsView: View {
}) { }) {
Text("Clear App Cache") Text("Clear App Cache")
} }
.buttonStyle(TintedButton(color: .red, fullwidth: true)) .foregroundStyle(.red)
} header: {
Label("Actions", systemImage: "gear")
} }
// MARK: Links // MARK: Links
Section { Section {
if let scURL = URL(string: PosterBoardManager.ShortcutURL) { if let scURL = URL(string: PosterBoardManager.ShortcutURL) {
Link(destination: scURL) { Link(destination: scURL) {
Text("Download Shortcut") Label("Download Shortcut", systemImage: "arrow.down.circle")
} }
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
} }
if let fbURL = URL(string: "shortcuts://run-shortcut?name=PosterBoard&input=text&text=troubleshoot") { if let fbURL = URL(string: "shortcuts://run-shortcut?name=PosterBoard&input=text&text=troubleshoot") {
Link(destination: fbURL) { Link(destination: fbURL) {
Text("Create Fallback Method") Label("Create Fallback Method", systemImage: "appclip")
} }
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
} }
if let wpURL = URL(string: PosterBoardManager.WallpapersURL) { if let wpURL = URL(string: PosterBoardManager.WallpapersURL) {
Link(destination: wpURL) { Link(destination: wpURL) {
Text("Find Wallpapers") Label("Find Wallpapers", systemImage: "safari")
} }
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
} }
} header: { } header: {
Text("Links") Label("Links", systemImage: "link")
} }
// TODO: Credits // TODO: Credits