Skip to content

Commit 0c5a3c1

Browse files
feat(tvOS): retrowave consistency wave 2 — RetroAchievements, Controller, Backup, BatchArtwork
- RetroAchievementsView: tvOS 80pt inset + retroFocusButtonStyle on login/disconnect - ControllerSettingsView: RetroSettingsBackground, RetroSettingsSectionHeader on all sections, retroFocusButtonStyle replaces .card/.retroThemedFocus throughout - BackupRestoreView: RetroSettingsBackground + tvOSSettingsHorizontalPadding; migrate Backup/Restore buttons to RetroSettingsActionButton - BatchArtworkMatchingView: tvOSSettingsHorizontalPadding + retroFocusButtonStyle on all action buttons Part of #3598 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 45d52dc commit 0c5a3c1

File tree

4 files changed

+59
-95
lines changed

4 files changed

+59
-95
lines changed

PVUI/Sources/PVSwiftUI/Settings/RetroAchievementsView.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public struct RetroAchievementsView: View {
9898
}
9999
}
100100
.padding()
101+
.tvOSSettingsHorizontalPadding()
101102
}
102103
}
103104
.navigationTitle("RetroAchievements")
@@ -342,8 +343,7 @@ public struct RetroAchievementsView: View {
342343
.shadow(color: RetroTheme.retroPink.opacity(0.5), radius: 5)
343344
}
344345
#if os(tvOS)
345-
.buttonStyle(.card)
346-
.retroThemedFocus(cornerRadius: 12)
346+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 3, cornerRadius: 12)
347347
#else
348348
.buttonStyle(.plain)
349349
#endif
@@ -474,8 +474,7 @@ public struct RetroAchievementsView: View {
474474
)
475475
}
476476
#if os(tvOS)
477-
.buttonStyle(.card)
478-
.retroThemedFocus(cornerRadius: 8, primaryColor: .red, secondaryColor: .retroPink)
477+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 2.5, cornerRadius: 8, primaryColor: .red, secondaryColor: .retroPink)
479478
#else
480479
.buttonStyle(.plain)
481480
#endif

PVUI/Sources/PVSwiftUI/Settings/Views/BackupRestoreView.swift

Lines changed: 24 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ struct BackupRestoreView: View {
4242

4343
var body: some View {
4444
ZStack {
45-
Color.black.edgesIgnoringSafeArea(.all)
46-
RetroGrid()
47-
.edgesIgnoringSafeArea(.all)
48-
.opacity(0.3)
45+
RetroSettingsBackground()
4946

5047
ScrollView {
5148
VStack(spacing: 24) {
@@ -55,9 +52,8 @@ struct BackupRestoreView: View {
5552
restoreSectionView
5653
infoView
5754
}
58-
#if os(tvOS)
59-
.padding(.horizontal, 80)
60-
#else
55+
.tvOSSettingsHorizontalPadding()
56+
#if !os(tvOS)
6157
.padding(.horizontal)
6258
#endif
6359
.padding(.bottom, 40)
@@ -310,57 +306,31 @@ struct BackupRestoreView: View {
310306
}
311307

312308
private var createBackupButton: some View {
313-
Button(action: startBackup) {
314-
HStack {
315-
Image(systemName: "arrow.up.doc.fill")
316-
Text("Create Backup")
317-
.fontWeight(.semibold)
318-
}
319-
.frame(maxWidth: .infinity)
320-
.padding(.vertical, 12)
321-
.background(
322-
LinearGradient(
323-
gradient: Gradient(colors: [.retroPink, .retroPurple]),
324-
startPoint: .leading,
325-
endPoint: .trailing
326-
)
327-
)
328-
.foregroundColor(.white)
329-
.cornerRadius(10)
330-
}
309+
RetroSettingsActionButton(
310+
title: "Create Backup",
311+
icon: "arrow.up.doc.fill",
312+
color: .retroPink,
313+
action: startBackup
314+
)
331315
.disabled(selectedContents.isEmpty)
332316
}
333317

334318
private var restoreButton: some View {
335-
Button(action: {
336-
#if !os(tvOS)
337-
showFileImporter = true
338-
#else
339-
startTVOSRestore()
340-
#endif
341-
}) {
342-
HStack {
343-
Image(systemName: "arrow.down.doc.fill")
344-
#if os(tvOS)
345-
Text("Restore from Documents")
346-
.fontWeight(.semibold)
347-
#else
348-
Text("Choose Backup File")
349-
.fontWeight(.semibold)
350-
#endif
351-
}
352-
.frame(maxWidth: .infinity)
353-
.padding(.vertical, 12)
354-
.background(
355-
LinearGradient(
356-
gradient: Gradient(colors: [.retroBlue, .retroPurple]),
357-
startPoint: .leading,
358-
endPoint: .trailing
359-
)
360-
)
361-
.foregroundColor(.white)
362-
.cornerRadius(10)
363-
}
319+
#if os(tvOS)
320+
RetroSettingsActionButton(
321+
title: "Restore from Documents",
322+
icon: "arrow.down.doc.fill",
323+
color: .retroBlue,
324+
action: startTVOSRestore
325+
)
326+
#else
327+
RetroSettingsActionButton(
328+
title: "Choose Backup File",
329+
icon: "arrow.down.doc.fill",
330+
color: .retroBlue,
331+
action: { showFileImporter = true }
332+
)
333+
#endif
364334
}
365335

366336
private var infoView: some View {

PVUI/Sources/PVSwiftUI/Settings/Views/BatchArtworkMatchingView.swift

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,17 @@ public struct BatchArtworkMatchingView: View {
8484

8585
// Filter controls
8686
filterControls
87+
.tvOSSettingsHorizontalPadding()
88+
#if !os(tvOS)
8789
.padding(.horizontal)
90+
#endif
8891

8992
// Action buttons
9093
actionButtons
94+
.tvOSSettingsHorizontalPadding()
95+
#if !os(tvOS)
9196
.padding(.horizontal)
97+
#endif
9298

9399
// Content area
94100
if isLoading {
@@ -253,8 +259,7 @@ public struct BatchArtworkMatchingView: View {
253259
)
254260
}
255261
#if os(tvOS)
256-
.buttonStyle(.card)
257-
.retroThemedFocus(cornerRadius: 8)
262+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 2.5, cornerRadius: 8)
258263
#else
259264
.buttonStyle(PlainButtonStyle())
260265
#endif
@@ -290,8 +295,7 @@ public struct BatchArtworkMatchingView: View {
290295
)
291296
}
292297
#if os(tvOS)
293-
.buttonStyle(.card)
294-
.retroThemedFocus(cornerRadius: 8)
298+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 2.5, cornerRadius: 8, primaryColor: .retroPink, secondaryColor: .retroPurple)
295299
#else
296300
.buttonStyle(PlainButtonStyle())
297301
#endif
@@ -328,8 +332,7 @@ public struct BatchArtworkMatchingView: View {
328332
)
329333
}
330334
#if os(tvOS)
331-
.buttonStyle(.card)
332-
.retroThemedFocus(cornerRadius: 8)
335+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 2.5, cornerRadius: 8, primaryColor: .retroPurple, secondaryColor: .retroPink)
333336
#else
334337
.buttonStyle(PlainButtonStyle())
335338
#endif
@@ -444,8 +447,7 @@ public struct BatchArtworkMatchingView: View {
444447
)
445448
}
446449
#if os(tvOS)
447-
.buttonStyle(.card)
448-
.retroThemedFocus()
450+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 2, cornerRadius: 20)
449451
#else
450452
.buttonStyle(.plain)
451453
#endif
@@ -472,8 +474,7 @@ public struct BatchArtworkMatchingView: View {
472474
)
473475
}
474476
#if os(tvOS)
475-
.buttonStyle(.card)
476-
.retroThemedFocus()
477+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 2.5, cornerRadius: 20, primaryColor: .retroPink, secondaryColor: .retroPurple)
477478
#else
478479
.buttonStyle(.plain)
479480
#endif

PVUI/Sources/PVSwiftUI/Settings/Views/ControllerSettingsView.swift

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,18 @@ struct ControllerSettingsView: View {
198198
}
199199
}
200200
#if os(tvOS)
201-
.buttonStyle(.card)
202-
.retroThemedFocus(cornerRadius: 12)
201+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 2.5, cornerRadius: 12)
203202
#endif
204203
}
205204
} header: {
205+
#if os(tvOS)
206+
RetroSettingsSectionHeader(icon: "slider.horizontal.3", title: "Button Remapping")
207+
#else
206208
HStack {
207209
Image(systemName: "slider.horizontal.3")
208210
Text("Button Remapping")
209211
}
210212
.font(.headline)
211-
#if os(tvOS)
212-
.foregroundColor(.retroPink)
213213
#endif
214214
} footer: {
215215
Text("Customize button mappings for each connected controller.")
@@ -290,20 +290,20 @@ struct ControllerSettingsView: View {
290290
#endif
291291
}
292292
#if os(tvOS)
293-
.buttonStyle(.card)
294-
.retroThemedFocus(cornerRadius: 12)
293+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 2.5, cornerRadius: 12)
295294
#else
296295
.buttonStyle(.plain)
297296
#endif
298297
}
299298
} header: {
299+
#if os(tvOS)
300+
RetroSettingsSectionHeader(icon: "gamecontroller.fill", title: "Controller Assignments")
301+
#else
300302
HStack {
301303
Image(systemName: "gamecontroller.fill")
302304
Text("Controller Assignments")
303305
}
304306
.font(.headline)
305-
#if os(tvOS)
306-
.foregroundColor(.retroPink)
307307
#endif
308308
} footer: {
309309
VStack(alignment: .leading, spacing: 8) {
@@ -347,13 +347,14 @@ struct ControllerSettingsView: View {
347347
)
348348
}
349349
} header: {
350+
#if os(tvOS)
351+
RetroSettingsSectionHeader(icon: "person.2.fill", title: "Preferred Player Slots")
352+
#else
350353
HStack {
351354
Image(systemName: "person.2.fill")
352355
Text("Preferred Player Slots")
353356
}
354357
.font(.headline)
355-
#if os(tvOS)
356-
.foregroundColor(.retroPink)
357358
#endif
358359
} footer: {
359360
VStack(alignment: .leading, spacing: 4) {
@@ -398,16 +399,17 @@ struct ControllerSettingsView: View {
398399
.foregroundColor(.red)
399400
}
400401
#if os(tvOS)
401-
.buttonStyle(.card)
402+
.retroFocusButtonStyle(focusScale: 1.04, focusBorderWidth: 2.5, cornerRadius: 10, primaryColor: .red, secondaryColor: .retroPink)
402403
#endif
403404
} header: {
405+
#if os(tvOS)
406+
RetroSettingsSectionHeader(icon: "gearshape.2", title: "Preferences")
407+
#else
404408
HStack {
405409
Image(systemName: "gearshape.2")
406410
Text("Preferences")
407411
}
408412
.font(.headline)
409-
#if os(tvOS)
410-
.foregroundColor(.retroPink)
411413
#endif
412414
} footer: {
413415
Text("Clears all saved controller-to-player slot assignments and reverts to automatic assignment.")
@@ -427,31 +429,23 @@ struct ControllerSettingsView: View {
427429
Label("Full Controller Wiki", systemImage: "books.vertical.fill")
428430
}
429431
} header: {
432+
#if os(tvOS)
433+
RetroSettingsSectionHeader(icon: "questionmark.circle", title: "Help & Guides")
434+
#else
430435
HStack {
431436
Image(systemName: "questionmark.circle")
432437
Text("Help & Guides")
433438
}
434439
.font(.headline)
435-
#if os(tvOS)
436-
.foregroundColor(.retroPink)
437440
#endif
438441
}
439442
}
440443
#if os(tvOS)
441444
.listStyle(.plain)
442-
.background(
443-
LinearGradient(
444-
gradient: Gradient(colors: [
445-
Color.black,
446-
RetroTheme.retroPurple.opacity(0.1),
447-
RetroTheme.retroPink.opacity(0.05)
448-
]),
449-
startPoint: .top,
450-
endPoint: .bottom
451-
)
452-
)
445+
.scrollContentBackground(.hidden)
446+
.background { RetroSettingsBackground() }
447+
.padding(.horizontal, 80)
453448
#else
454-
// .scrollContentBackground(.hidden)
455449
.listStyle(.insetGrouped)
456450
#endif
457451
.navigationTitle("Controller Settings")

0 commit comments

Comments
 (0)