Skip to content

Commit

Permalink
added copy-paste to desktop app
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusellison authored and jaredp committed Jun 8, 2019
1 parent 43df450 commit e3bdc2f
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion desktop-app/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
const {app, BrowserWindow, Menu} = require('electron')

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
Expand All @@ -23,6 +23,27 @@ function createWindow () {
// when you should delete the corresponding element.
mainWindow = null
})
// Create the Application's main menu
let template = [{
label: "Application",
submenu: [
{ label: "About Application", selector: "orderFrontStandardAboutPanel:" },
{ type: "separator" },
{ label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }}
]}, {
label: "Edit",
submenu: [
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
{ type: "separator" },
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
]}
];

Menu.setApplicationMenu(Menu.buildFromTemplate(template));
}

// This method will be called when Electron has finished
Expand Down

0 comments on commit e3bdc2f

Please sign in to comment.