Skip to content

Commit

Permalink
Add showSaveImage option (sindresorhus#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias-Keller committed Mar 27, 2020
1 parent d47071e commit 2f1bae0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions index.d.ts
Expand Up @@ -143,6 +143,13 @@ declare namespace contextMenu {
*/
readonly showCopyImageAddress?: boolean;

/**
Show the `Save Image` menu item when right-clicking on an image.
@default false
*/
readonly showSaveImage?: boolean;

/**
Show the `Save Image As…` menu item when right-clicking on an image.
Expand Down
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -181,7 +181,7 @@ const create = (win, options) => {
defaultActions.copy(),
defaultActions.paste(),
defaultActions.separator(),
defaultActions.saveImage(),
options.showSaveImage && defaultActions.saveImage(),
options.showSaveImageAs && defaultActions.saveImageAs(),
options.showCopyImage !== false && defaultActions.copyImage(),
options.showCopyImageAddress && defaultActions.copyImageAddress(),
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Expand Up @@ -104,6 +104,13 @@ Default: `false`

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

#### showSaveImage

Type: `boolean`\
Default: `false`

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

#### showSaveImageAs

Type: `boolean`\
Expand Down

0 comments on commit 2f1bae0

Please sign in to comment.