update: add menu toggle command

This commit is contained in:
ocogeclub 2021-02-17 22:06:05 +09:00
parent f61f2a7ab7
commit c74ffbeff3
4 changed files with 24 additions and 14 deletions

View File

@ -59,18 +59,11 @@ app.on('ready', () => {
label: 'Menu', label: 'Menu',
submenu: [ submenu: [
{ {
label: 'Quit', label: 'Toggle Menu Bar',
click: () => { click: () => {
app.quit(); win.setMenuBarVisibility(!win.menuBarVisible);
}, },
accelerator: "CommandOrControl+Q" accelerator: "CommandOrControl+Shift+M"
},
{
label: 'Toggle Developer Tools',
click: () => {
win.webContents.toggleDevTools()
},
accelerator: "F12"
}, },
{ {
label: 'Reload', label: 'Reload',
@ -87,6 +80,13 @@ app.on('ready', () => {
}, },
accelerator: "CommandOrControl+M" accelerator: "CommandOrControl+M"
}, },
{
label: 'Toggle Developer Tools',
click: () => {
win.webContents.toggleDevTools()
},
accelerator: "F12"
},
{ {
label: 'About', label: 'About',
click: () => { click: () => {
@ -107,6 +107,13 @@ app.on('ready', () => {
require('electron').dialog.showMessageBox(win, options); require('electron').dialog.showMessageBox(win, options);
}, },
accelerator: "CommandOrControl+I" accelerator: "CommandOrControl+I"
},
{
label: 'Quit',
click: () => {
app.quit();
},
accelerator: "CommandOrControl+Q"
} }
] ]
} }

6
package-lock.json generated
View File

@ -775,9 +775,9 @@
} }
}, },
"electron": { "electron": {
"version": "11.2.1", "version": "11.2.3",
"resolved": "https://registry.npmjs.org/electron/-/electron-11.2.1.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-11.2.3.tgz",
"integrity": "sha512-Im1y29Bnil+Nzs+FCTq01J1OtLbs+2ZGLLllaqX/9n5GgpdtDmZhS/++JHBsYZ+4+0n7asO+JKQgJD+CqPClzg==", "integrity": "sha512-6yxOc42nDAptHKNlUG/vcOh2GI9x2fqp2nQbZO0/3sz2CrwsJkwR3i3oMN9XhVJaqI7GK1vSCJz0verOkWlXcQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@electron/get": "^1.0.1", "@electron/get": "^1.0.1",

View File

@ -19,7 +19,7 @@
}, },
"homepage": "https://github.com/ocogeclub/ocoge#readme", "homepage": "https://github.com/ocogeclub/ocoge#readme",
"devDependencies": { "devDependencies": {
"electron": "11.2.1", "electron": "11.2.3",
"electron-rebuild": "^2.3.4" "electron-rebuild": "^2.3.4"
}, },
"dependencies": { "dependencies": {

View File

@ -536,6 +536,9 @@ if (typeof require == 'function') {
elec.newFile = () => { ; } elec.newFile = () => { ; }
elec.setWsChanged = () => { ; } elec.setWsChanged = () => { ; }
// マスコット
elec.getMascotFilePath = () => './img/cogechee.png';
//ワークスペースのダウンロード //ワークスペースのダウンロード
elec.saveWsFile = xml_text => { elec.saveWsFile = xml_text => {
let blob = new Blob([xml_text], { "type": "text/xml" }); let blob = new Blob([xml_text], { "type": "text/xml" });