mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-02-04 03:07:36 +01:00
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}/`)
|
||||
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', () => {
|
||||
|
@ -54,17 +54,15 @@ export default function FollowRequests(props: Props) {
|
||||
</div>
|
||||
<div className="timeline overflow-y-auto w-full overflow-x-hidden" style={{ height: 'calc(100% - 44px)' }}>
|
||||
{requests.map(r => (
|
||||
<>
|
||||
<User
|
||||
key={r.id}
|
||||
user={r}
|
||||
client={props.client}
|
||||
refresh={async () => {
|
||||
const data = await refreshRequests()
|
||||
updateUnreads(data.length)
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
<User
|
||||
key={r.id}
|
||||
user={r}
|
||||
client={props.client}
|
||||
refresh={async () => {
|
||||
const data = await refreshRequests()
|
||||
updateUnreads(data.length)
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
Loading…
x
Reference in New Issue
Block a user