This commit is contained in:
Amelia 2026-05-30 18:52:41 +01:00 committed by GitHub
commit 0d363192da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions

View File

@ -149,7 +149,7 @@ export function createMainWindow() {
// configure spellchecker context menu // configure spellchecker context menu
mainWindow.webContents.on("context-menu", (_, params) => { mainWindow.webContents.on("context-menu", (_, params) => {
const menu = new Menu(); const menu = new Menu();
if (params.isEditable) {
// add all suggestions // add all suggestions
for (const suggestion of params.dictionarySuggestions) { for (const suggestion of params.dictionarySuggestions) {
menu.append( menu.append(
@ -182,6 +182,15 @@ export function createMainWindow() {
}, },
}), }),
); );
}
menu.append(
new MenuItem({
label: "Copy Image",
visible: params.hasImageContents,
click: () => mainWindow.webContents.copyImageAt(params.x, params.y),
}),
);
// show menu if we've generated enough entries // show menu if we've generated enough entries
if (menu.items.length > 0) { if (menu.items.length > 0) {