mirror of
https://github.com/yattee/yattee.git
synced 2024-11-14 01:58:24 +00:00
Merge pull request #742 from stonerl/subscription-button
Improvements to opening channels from Videos
This commit is contained in:
commit
516e305cd3
@ -380,7 +380,7 @@ struct ChannelVideosView: View {
|
|||||||
navigation.sidebarSectionChanged.toggle()
|
navigation.sidebarSectionChanged.toggle()
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
Label("Subscribe", systemImage: "circle")
|
Label("Subscribe", systemImage: "star.circle")
|
||||||
.help("Subscribe")
|
.help("Subscribe")
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.labelStyle(.automatic)
|
.labelStyle(.automatic)
|
||||||
|
@ -47,6 +47,12 @@ struct VideoDetails: View {
|
|||||||
.frame(width: 40, height: 40)
|
.frame(width: 40, height: 40)
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
.padding(.trailing, 5)
|
.padding(.trailing, 5)
|
||||||
|
// TODO: when setting tvOS minimum to 16, the platform modifier can be removed
|
||||||
|
#if !os(tvOS)
|
||||||
|
.simultaneousGesture(
|
||||||
|
TapGesture() // Ensures the button tap is recognized
|
||||||
|
)
|
||||||
|
#endif
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 2) {
|
VStack(alignment: .leading, spacing: 2) {
|
||||||
HStack {
|
HStack {
|
||||||
@ -55,6 +61,14 @@ struct VideoDetails: View {
|
|||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
|
// TODO: when setting tvOS minimum to 16, the platform modifier can be removed
|
||||||
|
#if !os(tvOS)
|
||||||
|
.onTapGesture {
|
||||||
|
guard let channel = video?.channel else { return }
|
||||||
|
NavigationModel.shared.openChannel(channel, navigationStyle: .sidebar)
|
||||||
|
}
|
||||||
|
.accessibilityAddTraits(.isButton)
|
||||||
|
#endif
|
||||||
} else if model.videoBeingOpened != nil {
|
} else if model.videoBeingOpened != nil {
|
||||||
Text("Yattee")
|
Text("Yattee")
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
@ -208,10 +222,10 @@ struct VideoDetails: View {
|
|||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
.padding(.horizontal, 16)
|
.padding(.horizontal, 16)
|
||||||
|
// TODO: when setting tvOS minimum to 16, the platform modifier can be removed
|
||||||
#if !os(tvOS)
|
#if !os(tvOS)
|
||||||
.tapRecognizer(
|
.simultaneousGesture( // Simultaneous gesture to prioritize button tap
|
||||||
tapSensitivity: 0.2,
|
TapGesture(count: 2).onEnded {
|
||||||
doubleTapAction: {
|
|
||||||
withAnimation(.default) {
|
withAnimation(.default) {
|
||||||
fullScreen.toggle()
|
fullScreen.toggle()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user