mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 05:02:53 +00:00
Add Copy Link to the macOS video context menu (#972)
SwiftUI's ShareLink menu on macOS offers no Copy Link item, so there was no way to copy a video URL from a context menu. Add a macOS-only Copy Link action next to Share.
This commit is contained in:
@@ -20190,6 +20190,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"video.context.copyLink" : {
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Copy Link"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"video.context.download" : {
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
|
||||
@@ -267,6 +267,17 @@ struct VideoContextMenuContent: View {
|
||||
Label(String(localized: "video.context.share"), systemImage: "square.and.arrow.up")
|
||||
}
|
||||
#endif
|
||||
|
||||
// The macOS ShareLink menu has no Copy Link item (#972)
|
||||
#if os(macOS)
|
||||
Button {
|
||||
let pasteboard = NSPasteboard.general
|
||||
pasteboard.clearContents()
|
||||
pasteboard.setString((appEnvironment?.shareURL(for: video) ?? video.shareURL).absoluteString, forType: .string)
|
||||
} label: {
|
||||
Label(String(localized: "video.context.copyLink"), systemImage: "link")
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
||||
Reference in New Issue
Block a user