mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Set full screen views background color based on color scheme on tvOS (fixes #30)
This commit is contained in:
@@ -9,6 +9,8 @@ struct ChannelPlaylistView: View {
|
||||
|
||||
@StateObject private var store = Store<ChannelPlaylist>()
|
||||
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
#if os(iOS)
|
||||
@Environment(\.inNavigationView) private var inNavigationView
|
||||
#endif
|
||||
@@ -83,7 +85,7 @@ struct ChannelPlaylistView: View {
|
||||
.navigationTitle(playlist.title)
|
||||
|
||||
#else
|
||||
.background(Color.tertiaryBackground)
|
||||
.background(Color.background(scheme: colorScheme))
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -9,6 +9,7 @@ struct ChannelVideosView: View {
|
||||
|
||||
@StateObject private var store = Store<Channel>()
|
||||
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@Environment(\.presentationMode) private var presentationMode
|
||||
@Environment(\.inNavigationView) private var inNavigationView
|
||||
|
||||
@@ -105,8 +106,6 @@ struct ChannelVideosView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
.background(Color.tertiaryBackground)
|
||||
#endif
|
||||
#if os(iOS)
|
||||
.sheet(isPresented: $presentingShareSheet) {
|
||||
@@ -126,6 +125,9 @@ struct ChannelVideosView: View {
|
||||
return Group {
|
||||
if #available(macOS 12.0, *) {
|
||||
content
|
||||
#if os(tvOS)
|
||||
.background(Color.background(scheme: colorScheme))
|
||||
#endif
|
||||
#if !os(iOS)
|
||||
.focusScope(focusNamespace)
|
||||
#endif
|
||||
|
@@ -25,13 +25,19 @@ struct DetailBadge: View {
|
||||
}
|
||||
|
||||
struct DefaultStyleModifier: ViewModifier {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, *) {
|
||||
content
|
||||
.background(.thinMaterial)
|
||||
} else {
|
||||
content
|
||||
.background(Color.background.opacity(0.95))
|
||||
#if os(tvOS)
|
||||
.background(Color.background(scheme: colorScheme))
|
||||
#else
|
||||
.background(Color.background.opacity(0.95))
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -106,7 +106,9 @@ struct PlayerControlsView<Content: View>: View {
|
||||
.background(Material.ultraThinMaterial)
|
||||
} else {
|
||||
controls
|
||||
.background(Color.tertiaryBackground)
|
||||
#if !os(tvOS)
|
||||
.background(Color.tertiaryBackground)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user