@@ -141,7 +141,31 @@ function buildAppMenu(): Menu {
|
||||
],
|
||||
},
|
||||
{ role: 'editMenu' },
|
||||
{ role: 'viewMenu' },
|
||||
{
|
||||
label: 'View',
|
||||
submenu: [
|
||||
// ⌘R refreshes git status + the file explorer instead of reloading the
|
||||
// window. We send the same "project changed" ping the disk watchers use,
|
||||
// which makes the renderer re-read git + the file tree. Reload / Force
|
||||
// Reload are intentionally omitted so ⌘R never blows away app state.
|
||||
{
|
||||
label: 'Refresh',
|
||||
accelerator: 'CmdOrCtrl+R',
|
||||
click: (_m, win) => {
|
||||
const bw = win instanceof BrowserWindow ? win : BrowserWindow.getFocusedWindow()
|
||||
bw?.webContents.send('project:changed')
|
||||
},
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{ role: 'toggleDevTools' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'resetZoom' },
|
||||
{ role: 'zoomIn' },
|
||||
{ role: 'zoomOut' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'togglefullscreen' },
|
||||
],
|
||||
},
|
||||
{ role: 'windowMenu' },
|
||||
]
|
||||
return Menu.buildFromTemplate(template)
|
||||
|
||||
Reference in New Issue
Block a user