Files
yattee/Yattee/Views/Settings/AcknowledgementsView.swift
Arkadiusz Fal 39beb45cff Make tvOS detail dismiss button opt-in and unstick more views
TVSidebarDetailContainer now exposes a showsDismissButton flag instead of
always attaching a Done toolbar item. The button is only enabled where a
view can end up with no focusable element on its own — Device
Capabilities (informational rows) and the Import Playlists/Subscriptions
flows.

Wrap Contributors, Translators, Acknowledgements, and Device Capabilities
destinations in TVSidebarDetailContainer for the consistent sidebar look,
and make the Translators/Acknowledgements rows focusable on tvOS by
wrapping them in Buttons so the Menu remote button can pop the stack.
2026-05-06 22:41:46 +02:00

55 lines
1.4 KiB
Swift

//
// AcknowledgementsView.swift
// Yattee
//
// Lists dependencies and open source libraries used in the app.
//
import SwiftUI
struct AcknowledgementsView: View {
@Environment(\.openURL) private var openURL
var body: some View {
SettingsFormContainer {
SettingsFormSection("settings.acknowledgements.dependencies.header") {
dependencyLink("mpv", url: "https://github.com/mpv-player/mpv")
dependencyLink("MPVKit", url: "https://github.com/mpvkit/MPVKit")
dependencyLink("Nuke", url: "https://github.com/kean/Nuke")
}
}
.navigationTitle(String(localized: "settings.acknowledgements.title"))
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
#endif
}
@ViewBuilder
private func dependencyLink(_ name: String, url: String) -> some View {
Button {
if let url = URL(string: url) {
openURL(url)
}
} label: {
HStack {
Text(name)
Spacer()
#if !os(tvOS)
Image(systemName: "arrow.up.right")
.foregroundStyle(.secondary)
#endif
}
.contentShape(Rectangle())
}
#if os(macOS)
.buttonStyle(.plain)
#endif
}
}
#Preview {
NavigationStack {
AcknowledgementsView()
}
}