first version commit

This commit is contained in:
2020-06-07 23:17:01 +08:00
commit 0b9b3d4878
17 changed files with 1952 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
const { Menu } = require('electron');
function getMenu(/** @type Electron.BrowserWindow */mainWindow, miniWindow, current) {
const template = [{
label: "选项",
submenu: Menu.buildFromTemplate([
{
label: "显示主界面",
click: () => {
if (!mainWindow) { return; }
mainWindow.show();
mainWindow.focus();
}
},
{
label: "显示MINI窗口",
click: () => {
if (!miniWindow) { return; }
miniWindow.show();
miniWindow.focus();
}
},
{
label: "打开调试控制台",
click: () => current.webContents.openDevTools()
},
{
label: "退出",
role: 'quit'
}
])
}];
return Menu.buildFromTemplate(template);
}
module.exports = getMenu;