зеркало из https://github.com/electron/electron.git
Add reload menu item role
This commit is contained in:
Родитель
28c39d5151
Коммит
0698b5f1be
|
@ -84,11 +84,7 @@ app.once('ready', () => {
|
|||
label: 'View',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Reload',
|
||||
accelerator: 'CmdOrCtrl+R',
|
||||
click (item, focusedWindow) {
|
||||
if (focusedWindow) focusedWindow.reload()
|
||||
}
|
||||
role: 'reload'
|
||||
},
|
||||
{
|
||||
label: 'Toggle Developer Tools',
|
||||
|
|
|
@ -72,6 +72,11 @@ const roles = {
|
|||
accelerator: process.platform === 'win32' ? 'Control+Y' : 'Shift+CommandOrControl+Z',
|
||||
webContentsMethod: 'redo'
|
||||
},
|
||||
reload: {
|
||||
label: 'Reload',
|
||||
accelerator: 'CmdOrCtrl+R',
|
||||
windowMethod: 'reload'
|
||||
},
|
||||
resetzoom: {
|
||||
label: 'Actual Size',
|
||||
accelerator: 'CommandOrControl+0',
|
||||
|
@ -138,7 +143,7 @@ const canExecuteRole = (role) => {
|
|||
if (!roles.hasOwnProperty(role)) return false
|
||||
if (process.platform !== 'darwin') return true
|
||||
// macOS handles all roles natively except the ones listed below
|
||||
return ['zoomin', 'zoomout', 'resetzoom'].includes(role)
|
||||
return ['reload', 'resetzoom', 'zoomin', 'zoomout'].includes(role)
|
||||
}
|
||||
|
||||
exports.getDefaultLabel = (role) => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче