Skip to content

Commit

Permalink
add command shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Laird-McConnell committed Feb 27, 2019
1 parent 49caac4 commit 640606e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Office365/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mail.office365.com",
"productName": "Outlook for Office365",
"version": "1.0.2",
"version": "1.0.3",
"description": "Outlook for Office365 Desktop application",
"main": "src/main.js",
"author": "Tom Laird-McConnell",
Expand Down
24 changes: 23 additions & 1 deletion Office365/src/controller/mail-window-controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { BrowserWindow, shell, ipcMain } = require('electron')
const { BrowserWindow, shell, ipcMain, Menu } = require('electron')
const settings = require('electron-settings')
const CssInjector = require('../js/css-injector')
const path = require('path')
Expand Down Expand Up @@ -65,6 +65,28 @@ class MailWindowController {

// Open the new window in external browser
this.win.webContents.on('new-window', this.openInBrowser)

// Create the Application's main menu
var 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));
}

addUnreadNumberObserver() {
Expand Down
2 changes: 1 addition & 1 deletion Outlook.com/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "outlook.com",
"productName": "Outlook for Outlook.com",
"version": "1.0.2",
"version": "1.0.3",
"description": "Outlook for Outlook.com Desktop application",
"main": "src/main.js",
"author": "Tom Laird-McConnell",
Expand Down
26 changes: 24 additions & 2 deletions Outlook.com/src/controller/mail-window-controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { BrowserWindow, shell, ipcMain } = require('electron')
const { BrowserWindow, shell, ipcMain, Menu } = require('electron')
const settings = require('electron-settings')
const CssInjector = require('../js/css-injector')
const path = require('path')
Expand Down Expand Up @@ -63,7 +63,29 @@ class MailWindowController {
})

// Open the new window in external browser
this.win.webContents.on('new-window', this.openInBrowser)
this.win.webContents.on('new-window', this.openInBrowser);

// Create the Application's main menu
var 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));
}

addUnreadNumberObserver() {
Expand Down

0 comments on commit 640606e

Please sign in to comment.