feat: allow copying images from native context menu

closes stoatchat/for-web#738

Signed-off-by: Amy <amy+git@amogus.cloud>
This commit is contained in:
Amy 2026-03-03 15:29:25 -04:00
parent b57faa2c59
commit d38f422bee
1 changed files with 10 additions and 1 deletions

View File

@ -147,7 +147,7 @@ export function createMainWindow() {
// configure spellchecker context menu
mainWindow.webContents.on("context-menu", (_, params) => {
const menu = new Menu();
if (params.isEditable) {
// add all suggestions
for (const suggestion of params.dictionarySuggestions) {
menu.append(
@ -178,6 +178,15 @@ export function createMainWindow() {
click() {
config.spellchecker = !config.spellchecker;
},
}),
);
}
menu.append(
new MenuItem({
label: "Copy Image",
visible: params.hasImageContents,
click: () => mainWindow.webContents.copyImageAt(params.x, params.y),
}),
);