mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
modify dock.menu
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const BrowserWindow = electron.BrowserWindow
|
const BrowserWindow = electron.BrowserWindow
|
||||||
|
const shell = electron.shell
|
||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
{
|
{
|
||||||
@@ -90,7 +91,17 @@ module.exports = [
|
|||||||
click: function () {
|
click: function () {
|
||||||
BrowserWindow.getFocusedWindow().reload()
|
BrowserWindow.getFocusedWindow().reload()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
// {
|
||||||
|
// label: 'Toggle Developer Tools',
|
||||||
|
// accelerator: (function () {
|
||||||
|
// if (process.platform === 'darwin') return 'Alt+Command+I'
|
||||||
|
// else return 'Ctrl+Shift+I'
|
||||||
|
// })(),
|
||||||
|
// click: function (item, focusedWindow) {
|
||||||
|
// if (focusedWindow) BrowserWindow.getFocusedWindow().toggleDevTools()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -117,6 +128,24 @@ module.exports = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Help',
|
label: 'Help',
|
||||||
submenu: []
|
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') }
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -29,13 +29,6 @@ class HomePage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleKeyDown (e) {
|
handleKeyDown (e) {
|
||||||
if (e.keyCode === 73 && e.metaKey && e.altKey) {
|
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
remote.getCurrentWebContents().openDevTools()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isModalOpen()) {
|
if (isModalOpen()) {
|
||||||
if (e.keyCode === 27) closeModal()
|
if (e.keyCode === 27) closeModal()
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ app.on('ready', function () {
|
|||||||
var appIcon = new Tray(__dirname + '/resources/tray-icon.png')
|
var appIcon = new Tray(__dirname + '/resources/tray-icon.png')
|
||||||
appIcon.setToolTip('Boost')
|
appIcon.setToolTip('Boost')
|
||||||
|
|
||||||
|
var template = require('./atom-lib/menu-template')
|
||||||
|
var menu = Menu.buildFromTemplate(template)
|
||||||
|
Menu.setApplicationMenu(menu)
|
||||||
|
|
||||||
finderWindow = require('./atom-lib/finder-window')
|
finderWindow = require('./atom-lib/finder-window')
|
||||||
finderWindow.webContents.on('did-finish-load', function () {
|
finderWindow.webContents.on('did-finish-load', function () {
|
||||||
var trayMenu = new Menu()
|
var trayMenu = new Menu()
|
||||||
|
|||||||
Reference in New Issue
Block a user