Skip to content

Commit

Permalink
Tray menu updated. Fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
mariosinani authored and klaudiosinani committed Aug 31, 2017
1 parent fc87951 commit 4508417
Showing 1 changed file with 67 additions and 1 deletion.
68 changes: 67 additions & 1 deletion tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ const path = require('path');
const electron = require('electron');

const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const shell = electron.shell;
let tray = null;

function activate(command) {
const appWindow = BrowserWindow.getAllWindows()[0];
// Extra measure in order to be shown
appWindow.show();
appWindow.webContents.send(command);
}

exports.create = win => {
if (process.platform === 'darwin' || tray) {
return;
Expand All @@ -21,9 +30,66 @@ exports.create = win => {
};

const contextMenu = electron.Menu.buildFromTemplate([{
label: 'Toggle',
label: 'Open Tusk',
click() {
toggleWin();
}
}, {
type: 'separator'
}, {
label: 'Search',
click() {
toggleWin();
activate('search');
}
}, {
label: 'New Tag',
click() {
toggleWin();
activate('new-tag');
}
}, {
label: 'New Note',
click() {
toggleWin();
activate('new-note');
}
}, {
label: 'New Notebook',
click() {
toggleWin();
activate('new-notebook');
}
}, {
type: 'separator'
}, {
label: 'Toggle Dark Mode',
click() {
toggleWin();
activate('toggle-dark-mode');
}
}, {
label: 'Toggle Black Mode',
click() {
toggleWin();
activate('toggle-black-mode');
}
}, {
type: 'separator'
}, {
label: `Settings`,
click() {
shell.openExternal('https://www.evernote.com/Settings.action');
}
}, {
label: `Report Issue`,
click() {
shell.openExternal(`https://github.com/champloohq/tusk/issues/new`);
}
}, {
label: `Latest Release`,
click() {
shell.openExternal(`https://github.com/champloohq/tusk/releases/latest`);
}
}, {
type: 'separator'
Expand Down

0 comments on commit 4508417

Please sign in to comment.