gui: add explicit edit shortcuts (attempt to fix OSX issue #116)
This commit is contained in:
parent
d665222d9f
commit
e5a123977f
1 changed files with 16 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
var path = require('path'),
|
||||
{BrowserWindow} = require('electron'),
|
||||
{BrowserWindow, Menu} = require('electron'),
|
||||
shortcut = require('electron-localshortcut'),
|
||||
settings = require('./settings')
|
||||
|
||||
|
|
@ -25,6 +25,21 @@ module.exports = function(options={}) {
|
|||
window = null
|
||||
})
|
||||
|
||||
var template = [{
|
||||
label: 'Edit',
|
||||
submenu: [
|
||||
{role: 'undo', accelerator: "CmdOrCtrl+Z"},
|
||||
{role: 'redo', accelerator: "Shift+CmdOrCtrl+Z"},
|
||||
{type: 'separator'},
|
||||
{role: 'cut', accelerator: "CmdOrCtrl+X"},
|
||||
{role: 'copy', accelerator: "CmdOrCtrl+C"},
|
||||
{role: 'paste', accelerator: "CmdOrCtrl+V"}
|
||||
]
|
||||
}]
|
||||
|
||||
var menu = Menu.buildFromTemplate(template)
|
||||
Menu.setApplicationMenu(menu)
|
||||
|
||||
window.setMenuBarVisibility(false)
|
||||
|
||||
if (options.shortcuts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue