add reload menu in macOS dock
This commit is contained in:
parent
65dccf3729
commit
49be67aae6
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
out
|
||||||
|
npm-debug.log
|
7
main.js
7
main.js
@ -79,12 +79,15 @@ if (process.platform === 'darwin') {
|
|||||||
{role: 'front'}
|
{role: 'front'}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
const dockMenu = Menu.buildFromTemplate([
|
||||||
|
{label: 'Reload', click () { win.reload() }}
|
||||||
|
])
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow () {
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
const menu = Menu.buildFromTemplate(template)
|
const menu = Menu.buildFromTemplate(template)
|
||||||
Menu.setApplicationMenu(menu)
|
app.dock.setMenu(dockMenu);
|
||||||
|
Menu.setApplicationMenu(menu);
|
||||||
|
|
||||||
win = new BrowserWindow({width: 480, height: 600,icon: path.join(__dirname, 'ic_launcher.png')})
|
win = new BrowserWindow({width: 480, height: 600,icon: path.join(__dirname, 'ic_launcher.png')})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user