1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 05:40:32 +05:30

Fix buttons on tvOS

This commit is contained in:
Arkadiusz Fal 2023-05-27 00:06:39 +02:00
parent 166482601d
commit b1637c5ef1
2 changed files with 10 additions and 1 deletions

View File

@ -321,7 +321,9 @@ struct FavoriteItemView: View {
itemLabel itemLabel
.foregroundColor(.accentColor) .foregroundColor(.accentColor)
} }
#if !os(tvOS)
.buttonStyle(.plain) .buttonStyle(.plain)
#endif
} }
var itemNavigationLink: some View { var itemNavigationLink: some View {

View File

@ -27,9 +27,11 @@ struct AccentButton: View {
.frame(maxWidth: maxWidth) .frame(maxWidth: maxWidth)
.contentShape(Rectangle()) .contentShape(Rectangle())
} }
#if !os(tvOS)
.foregroundColor(.accentColor) .foregroundColor(.accentColor)
.buttonStyle(.plain) .buttonStyle(.plain)
.background(buttonBackground) .background(buttonBackground)
#endif
} }
var buttonBackground: some View { var buttonBackground: some View {
@ -40,6 +42,11 @@ struct AccentButton: View {
struct OpenVideosButton_Previews: PreviewProvider { struct OpenVideosButton_Previews: PreviewProvider {
static var previews: some View { 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)
}
} }
} }