mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
fix menu-template
This commit is contained in:
@@ -2,150 +2,159 @@ 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',
|
selector: 'orderFrontStandardAboutPanel:'
|
||||||
selector: 'orderFrontStandardAboutPanel:'
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'separator'
|
||||||
type: 'separator'
|
},
|
||||||
},
|
{
|
||||||
{
|
label: 'Services',
|
||||||
label: 'Services',
|
submenu: []
|
||||||
submenu: []
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'separator'
|
||||||
type: 'separator'
|
},
|
||||||
},
|
{
|
||||||
{
|
label: 'Hide Boost',
|
||||||
label: 'Hide Boost',
|
accelerator: 'Command+H',
|
||||||
accelerator: 'Command+H',
|
selector: 'hide:'
|
||||||
selector: 'hide:'
|
},
|
||||||
},
|
{
|
||||||
{
|
label: 'Hide Others',
|
||||||
label: 'Hide Others',
|
accelerator: 'Command+Shift+H',
|
||||||
accelerator: 'Command+Shift+H',
|
selector: 'hideOtherApplications:'
|
||||||
selector: 'hideOtherApplications:'
|
},
|
||||||
},
|
{
|
||||||
{
|
label: 'Show All',
|
||||||
label: 'Show All',
|
selector: 'unhideAllApplications:'
|
||||||
selector: 'unhideAllApplications:'
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'separator'
|
||||||
type: 'separator'
|
},
|
||||||
},
|
{
|
||||||
{
|
label: 'Quit',
|
||||||
label: 'Quit',
|
accelerator: 'Command+Q',
|
||||||
accelerator: 'Command+Q',
|
selector: 'terminate:'
|
||||||
selector: 'terminate:'
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
var edit = {
|
||||||
|
label: 'Edit',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'Undo',
|
||||||
|
accelerator: 'Command+Z',
|
||||||
|
selector: 'undo:'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Redo',
|
||||||
|
accelerator: 'Shift+Command+Z',
|
||||||
|
selector: 'redo:'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Cut',
|
||||||
|
accelerator: 'Command+X',
|
||||||
|
selector: 'cut:'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Copy',
|
||||||
|
accelerator: 'Command+C',
|
||||||
|
selector: 'copy:'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Paste',
|
||||||
|
accelerator: 'Command+V',
|
||||||
|
selector: 'paste:'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Select All',
|
||||||
|
accelerator: 'Command+A',
|
||||||
|
selector: 'selectAll:'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
var view = {
|
||||||
|
label: 'View',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'Reload',
|
||||||
|
accelerator: (function () {
|
||||||
|
if (process.platform === 'darwin') return 'Command+R'
|
||||||
|
else return 'Ctrl+R'
|
||||||
|
})(),
|
||||||
|
click: function () {
|
||||||
|
BrowserWindow.getFocusedWindow().reload()
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
},
|
// {
|
||||||
{
|
// label: 'Toggle Developer Tools',
|
||||||
label: 'Edit',
|
// accelerator: (function () {
|
||||||
submenu: [
|
// if (process.platform === 'darwin') return 'Alt+Command+I'
|
||||||
{
|
// else return 'Ctrl+Shift+I'
|
||||||
label: 'Undo',
|
// })(),
|
||||||
accelerator: 'Command+Z',
|
// click: function (item, focusedWindow) {
|
||||||
selector: 'undo:'
|
// if (focusedWindow) BrowserWindow.getFocusedWindow().toggleDevTools()
|
||||||
},
|
// }
|
||||||
{
|
// }
|
||||||
label: 'Redo',
|
]
|
||||||
accelerator: 'Shift+Command+Z',
|
}
|
||||||
selector: 'redo:'
|
|
||||||
},
|
var window = {
|
||||||
{
|
label: 'Window',
|
||||||
type: 'separator'
|
submenu: [
|
||||||
},
|
{
|
||||||
{
|
label: 'Minimize',
|
||||||
label: 'Cut',
|
accelerator: 'Command+M',
|
||||||
accelerator: 'Command+X',
|
selector: 'performMiniaturize:'
|
||||||
selector: 'cut:'
|
},
|
||||||
},
|
{
|
||||||
{
|
label: 'Close',
|
||||||
label: 'Copy',
|
accelerator: 'Command+W',
|
||||||
accelerator: 'Command+C',
|
selector: 'performClose:'
|
||||||
selector: 'copy:'
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'separator'
|
||||||
label: 'Paste',
|
},
|
||||||
accelerator: 'Command+V',
|
{
|
||||||
selector: 'paste:'
|
label: 'Bring All to Front',
|
||||||
},
|
selector: 'arrangeInFront:'
|
||||||
{
|
}
|
||||||
label: 'Select All',
|
]
|
||||||
accelerator: 'Command+A',
|
}
|
||||||
selector: 'selectAll:'
|
|
||||||
}
|
var help = {
|
||||||
]
|
label: 'Help',
|
||||||
},
|
role: 'help',
|
||||||
{
|
submenu: [
|
||||||
label: 'View',
|
{
|
||||||
submenu: [
|
label: 'Boost official site',
|
||||||
{
|
click: function () { shell.openExternal('https://b00st.io/') }
|
||||||
label: 'Reload',
|
},
|
||||||
accelerator: 'Command+R',
|
{
|
||||||
click: function () {
|
label: 'Tutorial page',
|
||||||
BrowserWindow.getFocusedWindow().reload()
|
click: function () { shell.openExternal('https://b00st.io/tutorial.html') }
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
label: 'Discussions',
|
||||||
label: 'Toggle Developer Tools',
|
click: function () { shell.openExternal('https://github.com/BoostIO/boost-app-discussions/issues') }
|
||||||
accelerator: (function () {
|
},
|
||||||
if (process.platform === 'darwin') return 'Alt+Command+I'
|
{
|
||||||
else return 'Ctrl+Shift+I'
|
label: 'Changelog',
|
||||||
})(),
|
click: function () { shell.openExternal('https://github.com/BoostIO/boost-releases/blob/master/changelog.md') }
|
||||||
click: function (item, focusedWindow) {
|
}
|
||||||
if (focusedWindow) BrowserWindow.getFocusedWindow().toggleDevTools()
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
]
|
module.exports = process.platform === 'darwin'
|
||||||
},
|
? [boost, edit, view, window, help]
|
||||||
{
|
: [view, help]
|
||||||
label: 'Window',
|
|
||||||
submenu: [
|
|
||||||
{
|
|
||||||
label: 'Minimize',
|
|
||||||
accelerator: 'Command+M',
|
|
||||||
selector: 'performMiniaturize:'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Close',
|
|
||||||
accelerator: 'Command+W',
|
|
||||||
selector: 'performClose:'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'separator'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Bring All to Front',
|
|
||||||
selector: 'arrangeInFront:'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Help',
|
|
||||||
role: 'help',
|
|
||||||
submenu: [
|
|
||||||
{
|
|
||||||
label: 'Boost official site',
|
|
||||||
click: function () { shell.openExternal('https://b00st.io/') }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Tutorial page',
|
|
||||||
click: function () { shell.openExternal('https://b00st.io/tutorial.html') }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Discussions',
|
|
||||||
click: function () { shell.openExternal('https://github.com/BoostIO/boost-app-discussions/issues') }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Changelog',
|
|
||||||
click: function () { shell.openExternal('https://github.com/BoostIO/boost-releases/blob/master/changelog.md') }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user