Adds Paste and Match Style to context menu [jgraph/drawio-desktop#1147]
This commit is contained in:
parent
32c2ed1718
commit
f24f81d0aa
@ -39,10 +39,24 @@ if (process.argv.indexOf('--disable-acceleration') !== -1)
|
|||||||
|
|
||||||
// Configure context menu for text fields
|
// Configure context menu for text fields
|
||||||
contextMenu({
|
contextMenu({
|
||||||
showCopyImage: false,
|
showCopyImage: true,
|
||||||
|
showSaveImage: true,
|
||||||
|
showSaveImageAs: true,
|
||||||
showLookUpSelection: false,
|
showLookUpSelection: false,
|
||||||
showSearchWithGoogle: false,
|
showSearchWithGoogle: false,
|
||||||
showCopyLink: false
|
showCopyLink: false,
|
||||||
|
showSelectAll: true,
|
||||||
|
append: (defaultActions, params, browserWindow) => [
|
||||||
|
{
|
||||||
|
label: 'Paste and Match Style',
|
||||||
|
// Only show this item when there's a text in the clipboard
|
||||||
|
visible: clipboard.availableFormats().includes('text/plain'),
|
||||||
|
click: () => {
|
||||||
|
// Execute the paste command in the focused window
|
||||||
|
browserWindow.webContents.pasteAndMatchStyle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
const __DEV__ = process.env.DRAWIO_ENV === 'dev'
|
const __DEV__ = process.env.DRAWIO_ENV === 'dev'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user