diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-03-20 17:14:12 +0000 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-03-20 17:14:12 +0000 |
| commit | 68ae67e39ffdd44287f91ef5955ec0480ec81f0a (patch) | |
| tree | 5e50f167d6ad88552f7bc9fe136214f883e8c105 /app | |
| parent | c806fb42875d779f73340c6d3e367a6184e81877 (diff) | |
| download | mullvadvpn-68ae67e39ffdd44287f91ef5955ec0480ec81f0a.tar.xz mullvadvpn-68ae67e39ffdd44287f91ef5955ec0480ec81f0a.zip | |
Add app menu to map hotkeys to standard actions (i.e copy/paste)
Diffstat (limited to 'app')
| -rw-r--r-- | app/main.js | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/app/main.js b/app/main.js index e1e2fd0b1a..f79855ca00 100644 --- a/app/main.js +++ b/app/main.js @@ -127,18 +127,39 @@ const createWindow = () => { }); }; +const createAppMenu = () => { + // Create the Application's main menu + const template = [ + { + label: 'Mullvad', + submenu: [ + { role: 'about' }, + { type: 'separator' }, + { role: 'quit' } + ] + }, + { + label: 'Edit', + submenu: [ + { role: 'cut' }, + { role: 'copy' }, + { role: 'paste' }, + { type: 'separator' }, + { role: 'selectall' } + ] + } + ]; + + Menu.setApplicationMenu(Menu.buildFromTemplate(template)); +}; + const createContextMenu = () => { let menuTemplate = [ - // Undo/redo has to be fixed in AccountInput - // {role: 'undo'}, - // {role: 'redo'}, - // {type: 'separator'}, - - {role: 'cut'}, - {role: 'copy'}, - {role: 'paste'}, - {type: 'separator'}, - {role: 'selectall'} + { role: 'cut' }, + { role: 'copy' }, + { role: 'paste' }, + { type: 'separator' }, + { role: 'selectall' } ]; // add inspect element on right click menu @@ -206,6 +227,7 @@ app.on('window-all-closed', () => { app.on('ready', () => { createTray(); createWindow(); + createAppMenu(); createContextMenu(); if(isDevelopment) { |
