1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

fix menu-template

This commit is contained in:
Dick Choi
2015-12-16 09:15:52 +09:00
parent 958469f526
commit 48f57376d3

View File

@@ -2,9 +2,8 @@ const electron = require('electron')
const BrowserWindow = electron.BrowserWindow const BrowserWindow = electron.BrowserWindow
const shell = electron.shell const shell = electron.shell
module.exports = [ var boost = {
{ label: 'Boost',
label: 'Electron',
submenu: [ submenu: [
{ {
label: 'About Boost', label: 'About Boost',
@@ -43,8 +42,9 @@ module.exports = [
selector: 'terminate:' selector: 'terminate:'
} }
] ]
}, }
{
var edit = {
label: 'Edit', label: 'Edit',
submenu: [ submenu: [
{ {
@@ -81,30 +81,35 @@ module.exports = [
selector: 'selectAll:' selector: 'selectAll:'
} }
] ]
}, }
{
var view = {
label: 'View', label: 'View',
submenu: [ submenu: [
{ {
label: 'Reload', label: 'Reload',
accelerator: 'Command+R', accelerator: (function () {
if (process.platform === 'darwin') return 'Command+R'
else return 'Ctrl+R'
})(),
click: function () { click: function () {
BrowserWindow.getFocusedWindow().reload() BrowserWindow.getFocusedWindow().reload()
} }
}, },
{ // {
label: 'Toggle Developer Tools', // label: 'Toggle Developer Tools',
accelerator: (function () { // accelerator: (function () {
if (process.platform === 'darwin') return 'Alt+Command+I' // if (process.platform === 'darwin') return 'Alt+Command+I'
else return 'Ctrl+Shift+I' // else return 'Ctrl+Shift+I'
})(), // })(),
click: function (item, focusedWindow) { // click: function (item, focusedWindow) {
if (focusedWindow) BrowserWindow.getFocusedWindow().toggleDevTools() // if (focusedWindow) BrowserWindow.getFocusedWindow().toggleDevTools()
} // }
} // }
] ]
}, }
{
var window = {
label: 'Window', label: 'Window',
submenu: [ submenu: [
{ {
@@ -125,8 +130,9 @@ module.exports = [
selector: 'arrangeInFront:' selector: 'arrangeInFront:'
} }
] ]
}, }
{
var help = {
label: 'Help', label: 'Help',
role: 'help', role: 'help',
submenu: [ submenu: [
@@ -148,4 +154,7 @@ module.exports = [
} }
] ]
} }
]
module.exports = process.platform === 'darwin'
? [boost, edit, view, window, help]
: [view, help]