Skip to content

Commit

Permalink
Add Copy Image option
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Andrei committed Jul 2, 2019
1 parent bf760be commit 19186d0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions index.js
Expand Up @@ -83,6 +83,14 @@ const create = (win, options) => {
webContents(win).insertText(clipboardContent);
}
}),
copyImage: decorateMenuItem({
id: 'copyImage',
label: 'Copy Image',
visible: props.mediaType === 'image',
click() {
webContents(win).copyImageAt(props.x, props.y);
}
}),
saveImage: decorateMenuItem({
id: 'save',
label: 'Save Image',
Expand Down Expand Up @@ -157,6 +165,7 @@ const create = (win, options) => {
defaultActions.separator(),
defaultActions.saveImage(),
options.showSaveImageAs && defaultActions.saveImageAs(),
defaultActions.copyImage(),
options.showCopyImageAddress && defaultActions.copyImageAddress(),
defaultActions.separator(),
defaultActions.copyLink(),
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Expand Up @@ -93,6 +93,13 @@ Default: `true`

Show the `Look Up {selection}` menu item when right-clicking text on macOS.

#### showCopyImage

Type: `boolean`<br>
Default: `true`

Show the `Copy Image` menu item when right-clicking on an image.

#### showCopyImageAddress

Type: `boolean`<br>
Expand Down

0 comments on commit 19186d0

Please sign in to comment.