mirror of
https://github.com/yattee/yattee.git
synced 2026-02-21 18:29:44 +00:00
Fix tvOS onboarding background transparency and button styling
Add opaque black background to onboarding on tvOS to prevent Home screen content from leaking through the fullScreenCover. Replace toolbar Skip button with plain overlay button to avoid blurred material style, and add tvOS card button style with default focus on Continue button.
This commit is contained in:
@@ -63,7 +63,19 @@ struct OnboardingSheetView: View {
|
||||
#elseif os(iOS)
|
||||
.tabViewStyle(.page(indexDisplayMode: .never))
|
||||
#endif
|
||||
#if os(tvOS)
|
||||
.background(Color.black.ignoresSafeArea())
|
||||
.overlay(alignment: .topLeading) {
|
||||
Button(String(localized: "onboarding.skip")) {
|
||||
completeOnboarding()
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(40)
|
||||
}
|
||||
#endif
|
||||
.interactiveDismissDisabled()
|
||||
#if !os(tvOS)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
Button(String(localized: "onboarding.skip")) {
|
||||
@@ -71,6 +83,7 @@ struct OnboardingSheetView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
.task {
|
||||
guard !hasCheckedLegacyData else { return }
|
||||
hasCheckedLegacyData = true
|
||||
|
||||
@@ -10,6 +10,10 @@ import SwiftUI
|
||||
struct OnboardingTitleScreen: View {
|
||||
let onContinue: () -> Void
|
||||
|
||||
#if os(tvOS)
|
||||
@FocusState private var continueButtonFocused: Bool
|
||||
#endif
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
let iconSize = min(max(geometry.size.height * 0.13, 60), 140)
|
||||
@@ -67,15 +71,26 @@ struct OnboardingTitleScreen: View {
|
||||
.font(.headline)
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding()
|
||||
#if os(tvOS)
|
||||
.background(Color.accentColor.opacity(0.2))
|
||||
#else
|
||||
.background(Color.accentColor)
|
||||
.foregroundStyle(.white)
|
||||
#endif
|
||||
.clipShape(RoundedRectangle(cornerRadius: 12))
|
||||
}
|
||||
#if os(tvOS)
|
||||
.buttonStyle(.card)
|
||||
.focused($continueButtonFocused)
|
||||
#endif
|
||||
.padding(.horizontal)
|
||||
.padding(.bottom)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.padding()
|
||||
#if os(tvOS)
|
||||
.onAppear { continueButtonFocused = true }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user