File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,19 @@ struct GeneratedImageView: View {
36
36
return AnyView ( Image ( systemName: " exclamationmark.triangle " ) . resizable ( ) )
37
37
}
38
38
39
- return AnyView ( Image ( theImage, scale: 1 , label: Text ( " generated " ) )
40
- . resizable ( )
41
- . clipShape ( RoundedRectangle ( cornerRadius: 20 ) )
39
+ return AnyView (
40
+ Image ( theImage, scale: 1 , label: Text ( " generated " ) )
41
+ . resizable ( )
42
+ . clipShape ( RoundedRectangle ( cornerRadius: 20 ) )
43
+ . contextMenu {
44
+ Button {
45
+ NSPasteboard . general. clearContents ( )
46
+ let nsimage = NSImage ( cgImage: theImage, size: NSSize ( width: theImage. width, height: theImage. height) )
47
+ NSPasteboard . general. writeObjects ( [ nsimage] )
48
+ } label: {
49
+ Text ( " Copy Photo " )
50
+ }
51
+ }
42
52
)
43
53
case . failed( _) :
44
54
return AnyView ( Image ( systemName: " exclamationmark.triangle " ) . resizable ( ) )
You can’t perform that action at this time.
0 commit comments