Merge pull request #7236 from yuya-oc/accelerator-for-redo

Use Ctrl+Y as the accelerator of redo on Windows
This commit is contained in:
Cheng Zhao 2016-09-19 15:53:44 +09:00 committed by GitHub
commit 0ac4b89a0a
2 changed files with 11 additions and 1 deletions

View file

@ -69,7 +69,7 @@ const roles = {
},
redo: {
label: 'Redo',
accelerator: 'Shift+CommandOrControl+Z',
accelerator: process.platform === 'win32' ? 'Control+Y' : 'Shift+CommandOrControl+Z',
webContentsMethod: 'redo'
},
resetzoom: {

View file

@ -417,6 +417,16 @@ describe('menu module', function () {
assert.equal(item.label, 'Hide Electron Test')
assert.equal(item.accelerator, undefined)
assert.equal(item.getDefaultRoleAccelerator(), 'Command+H')
item = new MenuItem({role: 'undo'})
assert.equal(item.label, 'Undo')
assert.equal(item.accelerator, undefined)
assert.equal(item.getDefaultRoleAccelerator(), 'CommandOrControl+Z')
item = new MenuItem({role: 'redo'})
assert.equal(item.label, 'Redo')
assert.equal(item.accelerator, undefined)
assert.equal(item.getDefaultRoleAccelerator(), process.platform === 'win32' ? 'Control+Y' : 'Shift+CommandOrControl+Z')
})
})
})