parent
eb99b8ab00
commit
5fb3ed2b7a
1 changed files with 27 additions and 0 deletions
@ -0,0 +1,27 @@ |
||||
"use strict"; |
||||
|
||||
const {Menu} = require("electron"); |
||||
|
||||
class MainMenu { |
||||
constructor(app) { |
||||
this.app = app; |
||||
this.menu = null; |
||||
this.buildItems(); |
||||
Menu.setApplicationMenu(this.menu); |
||||
} |
||||
|
||||
buildItems() { |
||||
const template = [ |
||||
...(process.platform === "darwin" ? [{ |
||||
role : "appMenu" |
||||
}] : []), |
||||
{ |
||||
role : "windowMenu" |
||||
} |
||||
]; |
||||
|
||||
this.menu = Menu.buildFromTemplate(template); |
||||
} |
||||
} |
||||
|
||||
module.exports = MainMenu; |
Loading…
Reference in new issue