Adds Paste and Match Style to context menu [jgraph/drawio-desktop#1147]

This commit is contained in:
Gaudenz Alder 2025-03-27 17:20:10 +01:00
parent 32c2ed1718
commit f24f81d0aa

View File

@ -39,10 +39,24 @@ if (process.argv.indexOf('--disable-acceleration') !== -1)
// Configure context menu for text fields
contextMenu({
showCopyImage: false,
showCopyImage: true,
showSaveImage: true,
showSaveImageAs: true,
showLookUpSelection: 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'