🏁 Use Ctrl+Y as the accelerator of redo on Windows

This commit is contained in:
Yuya Ochiai 2016-09-17 01:26:07 +09:00
parent d4b204799d
commit 43f955194e
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')
})
})
})