mirror of
https://github.com/heyman/heynote.git
synced 2024-12-24 07:39:07 +01:00
96bd5f1f95
#build
104 lines
2.6 KiB
TypeScript
104 lines
2.6 KiB
TypeScript
const { app, Menu } = require('electron')
|
|
|
|
const isMac = process.platform === 'darwin'
|
|
|
|
const template = [
|
|
// { role: 'appMenu' }
|
|
...(isMac ? [{
|
|
label: app.name,
|
|
submenu: [
|
|
{ role: 'about' },
|
|
{ type: 'separator' },
|
|
{ role: 'services' },
|
|
{ type: 'separator' },
|
|
{ role: 'hide' },
|
|
{ role: 'hideOthers' },
|
|
{ role: 'unhide' },
|
|
{ type: 'separator' },
|
|
{ role: 'quit' }
|
|
]
|
|
}] : []),
|
|
// { role: 'fileMenu' }
|
|
/*{
|
|
label: 'File',
|
|
submenu: [
|
|
isMac ? { role: 'close' } : { role: 'quit' }
|
|
]
|
|
},*/
|
|
// { role: 'editMenu' }
|
|
{
|
|
label: 'Edit',
|
|
submenu: [
|
|
{ role: 'undo' },
|
|
{ role: 'redo' },
|
|
{ type: 'separator' },
|
|
{ role: 'cut' },
|
|
{ role: 'copy' },
|
|
{ role: 'paste' },
|
|
...(isMac ? [
|
|
{ role: 'pasteAndMatchStyle' },
|
|
{ role: 'delete' },
|
|
{ role: 'selectAll' },
|
|
{ type: 'separator' },
|
|
{
|
|
label: 'Speech',
|
|
submenu: [
|
|
{ role: 'startSpeaking' },
|
|
{ role: 'stopSpeaking' }
|
|
]
|
|
}
|
|
] : [
|
|
{ role: 'delete' },
|
|
{ type: 'separator' },
|
|
{ role: 'selectAll' }
|
|
])
|
|
]
|
|
},
|
|
// { role: 'viewMenu' }
|
|
{
|
|
label: 'View',
|
|
submenu: [
|
|
{ role: 'reload' },
|
|
{ role: 'forceReload' },
|
|
{ role: 'toggleDevTools' },
|
|
{ type: 'separator' },
|
|
{ role: 'resetZoom' },
|
|
{ role: 'zoomIn' },
|
|
{ role: 'zoomOut' },
|
|
{ type: 'separator' },
|
|
{ role: 'togglefullscreen' }
|
|
]
|
|
},
|
|
// { role: 'windowMenu' }
|
|
{
|
|
label: 'Window',
|
|
submenu: [
|
|
{ role: 'minimize' },
|
|
{ role: 'zoom' },
|
|
...(isMac ? [
|
|
{ type: 'separator' },
|
|
{ role: 'front' },
|
|
{ type: 'separator' },
|
|
{ role: 'window' }
|
|
] : [
|
|
{ role: 'close' }
|
|
])
|
|
]
|
|
},
|
|
{
|
|
role: 'help',
|
|
submenu: [
|
|
{
|
|
label: 'Learn More',
|
|
click: async () => {
|
|
const { shell } = require('electron')
|
|
await shell.openExternal('https://heynote.com')
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
export default Menu.buildFromTemplate(template)
|
|
|