Skip to content

Commit

Permalink
Add Share submenu to the right click menu
Browse files Browse the repository at this point in the history
  • Loading branch information
alin23 committed Oct 19, 2023
1 parent 3716414 commit 052d6ac
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Clop/RightClickMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ struct RightClickMenuView: View {
.keyboardShortcut("a")
.disabled(optimiser.aggresive)

Divider()

ShareMenu(optimiser: optimiser)

Button("Upload with Dropshare") {
optimiser.uploadWithDropshare()
}
Expand All @@ -129,6 +133,21 @@ struct RightClickMenuView: View {
}
}

struct ShareMenu: View {
@ObservedObject var optimiser: Optimiser

var body: some View {
Menu("Share") {
ForEach(NSSharingService.sharingServices(forItems: [optimiser.url]), id: \.title) { item in
Button(action: { item.perform(withItems: [optimiser.url]) }) {
SwiftUI.Image(nsImage: item.image)
Text(item.title)
}
}
}
}
}

struct ShortcutChoiceMenu: View {
@ObservedObject var shortcutsManager = SHM
@Environment(\.preview) var preview
Expand Down
4 changes: 4 additions & 0 deletions ReleaseNotes/2.2.6.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Improvements

- Add **Share** submenu to the right click menu

## Fixes

- Fix `--output` on `crop-pdf` not working correctly
Expand Down

0 comments on commit 052d6ac

Please sign in to comment.