From a05f5b9737dfd07f3834cbcf38cb03f6e80bf8b0 Mon Sep 17 00:00:00 2001 From: Rokt33r Date: Sun, 13 Dec 2015 18:25:52 +0900 Subject: [PATCH] modify dock.menu --- atom-lib/menu-template.js | 33 +++++++++++++++++++++++++++++++-- browser/main/HomePage.js | 7 ------- finder.js | 4 ++++ 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/atom-lib/menu-template.js b/atom-lib/menu-template.js index cadc401a..d1015cc6 100644 --- a/atom-lib/menu-template.js +++ b/atom-lib/menu-template.js @@ -1,5 +1,6 @@ const electron = require('electron') const BrowserWindow = electron.BrowserWindow +const shell = electron.shell module.exports = [ { @@ -90,7 +91,17 @@ module.exports = [ click: function () { 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', - 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') } + } + ] } ] diff --git a/browser/main/HomePage.js b/browser/main/HomePage.js index 9b44174b..7ccedd2d 100644 --- a/browser/main/HomePage.js +++ b/browser/main/HomePage.js @@ -29,13 +29,6 @@ class HomePage extends React.Component { } handleKeyDown (e) { - if (e.keyCode === 73 && e.metaKey && e.altKey) { - e.preventDefault() - e.stopPropagation() - remote.getCurrentWebContents().openDevTools() - return - } - if (isModalOpen()) { if (e.keyCode === 27) closeModal() return diff --git a/finder.js b/finder.js index 02da4244..627a3cbd 100755 --- a/finder.js +++ b/finder.js @@ -27,6 +27,10 @@ app.on('ready', function () { var appIcon = new Tray(__dirname + '/resources/tray-icon.png') 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.webContents.on('did-finish-load', function () { var trayMenu = new Menu()