Merge pull request #40 from h3poteto/iss-38

closes #38 Add edit and window menu
This commit is contained in:
AkiraFukushima 2018-03-13 16:13:08 +09:00 committed by GitHub
commit f4f5685cc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 68 additions and 2 deletions

View File

@ -31,13 +31,29 @@ function createWindow () {
* Set menu
*/
const template = [
{
label: 'Whalebird',
submenu: [
{
label: 'About Whalebird',
role: 'about'
},
{
type: 'separator'
},
{
label: 'Quit',
accelerator: 'CmdOrCtrl+Q',
role: 'quit'
}
]
},
{
label: 'Toot',
submenu: [
{
label: 'New Toot',
accelerator: 'CmdOrCtrl+N',
role: 'toot',
click: () => {
mainWindow.webContents.send('CmdOrCtrl+N')
}
@ -48,12 +64,62 @@ function createWindow () {
{
label: 'Reply',
accelerator: 'CmdOrCtrl+R',
role: 'reply',
click: () => {
mainWindow.webContents.send('CmdOrCtrl+R')
}
}
]
},
{
label: 'Edit',
submenu: [
{
label: 'Undo',
accelerator: 'CmdOrCtrl+Z',
role: 'undo'
},
{
label: 'Redo',
accelerator: 'Shift+CmdOrCtrl+Z',
role: 'redo'
},
{
type: 'separator'
},
{
label: 'Cut',
accelerator: 'CmdOrCtrl+X',
role: 'cut'
},
{
label: 'Copy',
accelerator: 'CmdOrCtrl+C',
role: 'copy'
},
{
label: 'Paste',
accelerator: 'CmdOrCtrl+V',
role: 'paste'
},
{
label: 'Select All',
accelerator: 'CmdOrCtrl+A',
role: 'selectall'
}
]
},
{
label: 'Window',
submenu: [
{
label: 'Close Window',
role: 'close'
},
{
label: 'Minimize',
role: 'minimize'
}
]
}
]