Fix compile error on tvOS

This commit is contained in:
Davide 2024-11-02 15:27:52 +01:00
parent aba5081450
commit 248f1e7257
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
3 changed files with 8 additions and 20 deletions

View File

@ -99,13 +99,6 @@ extension ThemeWindowModifier {
} }
} }
extension ThemeNavigationDetailModifier {
func body(content: Content) -> some View {
content
.navigationBarTitleDisplayMode(.inline)
}
}
extension ThemePlainButtonModifier { extension ThemePlainButtonModifier {
func body(content: Content) -> some View { func body(content: Content) -> some View {
Button(action: action) { Button(action: action) {

View File

@ -53,12 +53,6 @@ extension ThemeWindowModifier {
} }
} }
extension ThemeNavigationDetailModifier {
func body(content: Content) -> some View {
content
}
}
extension ThemePlainButtonModifier { extension ThemePlainButtonModifier {
func body(content: Content) -> some View { func body(content: Content) -> some View {
Button(action: action) { Button(action: action) {

View File

@ -91,15 +91,19 @@ extension View {
modifier(ThemeSectionWithHeaderFooterModifier(header: header, footer: footer)) modifier(ThemeSectionWithHeaderFooterModifier(header: header, footer: footer))
} }
public func themeNavigationDetail() -> some View {
#if os(iOS)
navigationBarTitleDisplayMode(.inline)
#else
self
#endif
}
#if !os(tvOS) #if !os(tvOS)
public func themeWindow(width: CGFloat, height: CGFloat) -> some View { public func themeWindow(width: CGFloat, height: CGFloat) -> some View {
modifier(ThemeWindowModifier(size: .init(width: width, height: height))) modifier(ThemeWindowModifier(size: .init(width: width, height: height)))
} }
public func themeNavigationDetail() -> some View {
modifier(ThemeNavigationDetailModifier())
}
public func themePlainButton(action: @escaping () -> Void) -> some View { public func themePlainButton(action: @escaping () -> Void) -> some View {
modifier(ThemePlainButtonModifier(action: action)) modifier(ThemePlainButtonModifier(action: action))
} }
@ -292,9 +296,6 @@ struct ThemeWindowModifier: ViewModifier {
let size: CGSize let size: CGSize
} }
struct ThemeNavigationDetailModifier: ViewModifier {
}
struct ThemePlainButtonModifier: ViewModifier { struct ThemePlainButtonModifier: ViewModifier {
let action: () -> Void let action: () -> Void
} }