From b1637c5ef1a61a7fb20b8b97e3dc11e3de28ae65 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 27 May 2023 00:06:39 +0200 Subject: [PATCH] Fix buttons on tvOS --- Shared/Home/FavoriteItemView.swift | 2 ++ Shared/Views/AccentButton.swift | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Shared/Home/FavoriteItemView.swift b/Shared/Home/FavoriteItemView.swift index 07e0aac4..33f3ac98 100644 --- a/Shared/Home/FavoriteItemView.swift +++ b/Shared/Home/FavoriteItemView.swift @@ -321,7 +321,9 @@ struct FavoriteItemView: View { itemLabel .foregroundColor(.accentColor) } + #if !os(tvOS) .buttonStyle(.plain) + #endif } var itemNavigationLink: some View { diff --git a/Shared/Views/AccentButton.swift b/Shared/Views/AccentButton.swift index 2bac94c2..5f4a0db7 100644 --- a/Shared/Views/AccentButton.swift +++ b/Shared/Views/AccentButton.swift @@ -27,9 +27,11 @@ struct AccentButton: View { .frame(maxWidth: maxWidth) .contentShape(Rectangle()) } + #if !os(tvOS) .foregroundColor(.accentColor) .buttonStyle(.plain) .background(buttonBackground) + #endif } var buttonBackground: some View { @@ -40,6 +42,11 @@ struct AccentButton: View { struct OpenVideosButton_Previews: PreviewProvider { static var previews: some View { - AccentButton(text: "Open Videos", imageSystemName: "play.circle.fill") + VStack { + AccentButton(text: "Open Videos", imageSystemName: "play.circle.fill") + .padding(.horizontal, 100) + AccentButton(text: "Open Videos", imageSystemName: "play.circle.fill") + .padding(.horizontal, 100) + } } }