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:
parent
b57faa2c59
commit
d38f422bee
|
|
@ -147,7 +147,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(
|
||||||
|
|
@ -178,6 +178,15 @@ export function createMainWindow() {
|
||||||
click() {
|
click() {
|
||||||
config.spellchecker = !config.spellchecker;
|
config.spellchecker = !config.spellchecker;
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
menu.append(
|
||||||
|
new MenuItem({
|
||||||
|
label: "Copy Image",
|
||||||
|
visible: params.hasImageContents,
|
||||||
|
click: () => mainWindow.webContents.copyImageAt(params.x, params.y),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue