Skip to content

Commit 854dd96

Browse files
committed
Merge branch 'master' of https://github.com/bluegill/katana
2 parents 7000ede + c252ec1 commit 854dd96

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/components/preferences.js

+22-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
const electron = require('electron')
21-
const { app, shell, BrowserWindow } = electron
21+
const { app, shell, BrowserWindow, Menu } = electron
2222

2323
const ipc = electron.ipcMain
2424

@@ -165,6 +165,27 @@ module.exports = class {
165165
shell.openExternal(url)
166166
})
167167

168+
var template = [{
169+
label: 'Application',
170+
submenu: [
171+
{ label: 'About Application', selector: 'orderFrontStandardAboutPanel:' },
172+
{ type: 'separator' },
173+
{ label: 'Quit', accelerator: 'Command+Q', click: function () { app.quit() }}
174+
]}, {
175+
label: 'Edit',
176+
submenu: [
177+
{ label: 'Undo', accelerator: 'CmdOrCtrl+Z', selector: 'undo:' },
178+
{ label: 'Redo', accelerator: 'Shift+CmdOrCtrl+Z', selector: 'redo:' },
179+
{ type: 'separator' },
180+
{ label: 'Cut', accelerator: 'CmdOrCtrl+X', selector: 'cut:' },
181+
{ label: 'Copy', accelerator: 'CmdOrCtrl+C', selector: 'copy:' },
182+
{ label: 'Paste', accelerator: 'CmdOrCtrl+V', selector: 'paste:' },
183+
{ label: 'Select All', accelerator: 'CmdOrCtrl+A', selector: 'selectAll:' }
184+
]}
185+
]
186+
187+
Menu.setApplicationMenu(Menu.buildFromTemplate(template))
188+
168189
this.window.once('ready-to-show', () => {
169190
this.window.show()
170191
})

0 commit comments

Comments
 (0)