Skip to content

Commit a05f5b9

Browse files
committed
modify dock.menu
1 parent 1963b58 commit a05f5b9

3 files changed

Lines changed: 35 additions & 9 deletions

File tree

atom-lib/menu-template.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const electron = require('electron')
22
const BrowserWindow = electron.BrowserWindow
3+
const shell = electron.shell
34

45
module.exports = [
56
{
@@ -90,7 +91,17 @@ module.exports = [
9091
click: function () {
9192
BrowserWindow.getFocusedWindow().reload()
9293
}
93-
}
94+
},
95+
// {
96+
// label: 'Toggle Developer Tools',
97+
// accelerator: (function () {
98+
// if (process.platform === 'darwin') return 'Alt+Command+I'
99+
// else return 'Ctrl+Shift+I'
100+
// })(),
101+
// click: function (item, focusedWindow) {
102+
// if (focusedWindow) BrowserWindow.getFocusedWindow().toggleDevTools()
103+
// }
104+
// }
94105
]
95106
},
96107
{
@@ -117,6 +128,24 @@ module.exports = [
117128
},
118129
{
119130
label: 'Help',
120-
submenu: []
131+
role: 'help',
132+
submenu: [
133+
{
134+
label: 'Boost official site',
135+
click: function () { shell.openExternal('https://b00st.io/') }
136+
},
137+
{
138+
label: 'Tutorial page',
139+
click: function () { shell.openExternal('https://b00st.io/tutorial.html') }
140+
},
141+
{
142+
label: 'Discussions',
143+
click: function () { shell.openExternal('https://github.com/BoostIO/boost-app-discussions/issues') }
144+
},
145+
{
146+
label: 'Changelog',
147+
click: function () { shell.openExternal('https://github.com/BoostIO/boost-releases/blob/master/changelog.md') }
148+
}
149+
]
121150
}
122151
]

browser/main/HomePage.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ class HomePage extends React.Component {
2929
}
3030

3131
handleKeyDown (e) {
32-
if (e.keyCode === 73 && e.metaKey && e.altKey) {
33-
e.preventDefault()
34-
e.stopPropagation()
35-
remote.getCurrentWebContents().openDevTools()
36-
return
37-
}
38-
3932
if (isModalOpen()) {
4033
if (e.keyCode === 27) closeModal()
4134
return

finder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ app.on('ready', function () {
2727
var appIcon = new Tray(__dirname + '/resources/tray-icon.png')
2828
appIcon.setToolTip('Boost')
2929

30+
var template = require('./atom-lib/menu-template')
31+
var menu = Menu.buildFromTemplate(template)
32+
Menu.setApplicationMenu(menu)
33+
3034
finderWindow = require('./atom-lib/finder-window')
3135
finderWindow.webContents.on('did-finish-load', function () {
3236
var trayMenu = new Menu()

0 commit comments

Comments
 (0)