summaryrefslogtreecommitdiff
path: root/Sora
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-06-25 06:57:52 -0700
committerFuwn <[email protected]>2025-06-25 06:57:52 -0700
commit98cf370a29793fc169174322ee6e6218a1e5b721 (patch)
tree1e39e18a43d193862f9f4eb1ea49a133b6abc877 /Sora
parentfeat: Development commit (diff)
downloadsora-testing-98cf370a29793fc169174322ee6e6218a1e5b721.tar.xz
sora-testing-98cf370a29793fc169174322ee6e6218a1e5b721.zip
feat: Development commit
Diffstat (limited to 'Sora')
-rw-r--r--Sora/Views/Post/Details/PostDetailsImageView.swift49
1 files changed, 25 insertions, 24 deletions
diff --git a/Sora/Views/Post/Details/PostDetailsImageView.swift b/Sora/Views/Post/Details/PostDetailsImageView.swift
index 7d52a51..a62171e 100644
--- a/Sora/Views/Post/Details/PostDetailsImageView.swift
+++ b/Sora/Views/Post/Details/PostDetailsImageView.swift
@@ -36,6 +36,20 @@ struct PostDetailsImageView<Placeholder: View>: View {
image: image,
contextMenu: Group {
#if os(iOS)
+ if settings.enableShareShortcut {
+ Button {
+ keyWindow?.rootViewController?.present(
+ UIActivityViewController(
+ activityItems: [url ?? URL(string: "")!], applicationActivities: nil
+ ), animated: true
+ )
+ } label: {
+ Label("Share", systemImage: "square.and.arrow.up")
+ }
+ }
+ #endif
+
+ #if os(iOS)
Button {
guard let url else { return }
@@ -46,8 +60,17 @@ struct PostDetailsImageView<Placeholder: View>: View {
}
.resume()
} label: {
- Label("Save Image", systemImage: "square.and.arrow.down")
+ Label("Save to Photos", systemImage: "square.and.arrow.down")
+ }
+ #endif
+
+ #if os(macOS)
+ Button {
+ saveImageToPicturesFolder()
+ } label: {
+ Label("Save to Pictures", systemImage: "square.and.arrow.down")
}
+ .keyboardShortcut("s", modifiers: [.command])
#endif
Button {
@@ -69,29 +92,7 @@ struct PostDetailsImageView<Placeholder: View>: View {
} label: {
Label("Copy", systemImage: "doc.on.doc")
}
-
- #if os(macOS)
- Button {
- saveImageToPicturesFolder()
- } label: {
- Label("Save Image", systemImage: "square.and.arrow.down")
- }
- .keyboardShortcut("s", modifiers: [.command])
- #endif
-
- #if os(iOS)
- if settings.enableShareShortcut {
- Button {
- keyWindow?.rootViewController?.present(
- UIActivityViewController(
- activityItems: [url ?? URL(string: "")!], applicationActivities: nil
- ), animated: true
- )
- } label: {
- Label("Share Image", systemImage: "square.and.arrow.up")
- }
- }
- #endif
+ .keyboardShortcut("c", modifiers: [.command])
Button {
openURL(postURL(for: post?.id ?? ""))