refs #5097 Add context menu to save images
This commit is contained in:
parent
cbe26b9d27
commit
4fb636e91c
@ -39,6 +39,26 @@ let main: BrowserWindow = null
|
|||||||
await mainWindow.loadURL(`http://localhost:${port}/`)
|
await mainWindow.loadURL(`http://localhost:${port}/`)
|
||||||
mainWindow.webContents.openDevTools()
|
mainWindow.webContents.openDevTools()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mainWindow.webContents.on('context-menu', (_event, properties) => {
|
||||||
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
|
{
|
||||||
|
label: 'Select All',
|
||||||
|
click: () => {
|
||||||
|
mainWindow.webContents.selectAll()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Save Image As',
|
||||||
|
visible: properties.mediaType === 'image',
|
||||||
|
click: () => {
|
||||||
|
console.log(properties.srcURL)
|
||||||
|
mainWindow.webContents.downloadURL(properties.srcURL)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
contextMenu.popup({ window: mainWindow })
|
||||||
|
})
|
||||||
})()
|
})()
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
|
@ -54,7 +54,6 @@ export default function FollowRequests(props: Props) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="timeline overflow-y-auto w-full overflow-x-hidden" style={{ height: 'calc(100% - 44px)' }}>
|
<div className="timeline overflow-y-auto w-full overflow-x-hidden" style={{ height: 'calc(100% - 44px)' }}>
|
||||||
{requests.map(r => (
|
{requests.map(r => (
|
||||||
<>
|
|
||||||
<User
|
<User
|
||||||
key={r.id}
|
key={r.id}
|
||||||
user={r}
|
user={r}
|
||||||
@ -64,7 +63,6 @@ export default function FollowRequests(props: Props) {
|
|||||||
updateUnreads(data.length)
|
updateUnreads(data.length)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user