Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Add more menu items to Electron wrapper #134
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Apr 24, 2017
1 parent 4fa4949 commit d3b73be
Showing 1 changed file with 91 additions and 15 deletions.
106 changes: 91 additions & 15 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,92 @@ function createWindow() {
{
role: 'paste',
},
{
role: 'pasteandmatchstyle',
},
{
role: 'delete',
},
{
role: 'selectall',
},
],
},
{
label: 'View',
submenu: [
{
role: 'reload',
},
{
type: 'separator',
},
{
role: 'togglefullscreen',
},
{
type: 'separator',
},
{
role: 'resetzoom',
},
{
role: 'zoomin',
},
{
role: 'zoomout',
},
],
},
{
label: 'Window',
submenu: [
{
role: 'minimize',
},
],
},
{
label: 'Help',
submenu: [
{
label: 'Official Lisk Website',
click: function () {
electron.shell.openExternal('https://lisk.io');
}
},
{
type: 'separator',
},
{
label: 'Lisk Chat',
click: function () {
electron.shell.openExternal('https://lisk.chat');
}
},
{
label: 'Lisk Forum',
click: function () {
electron.shell.openExternal('https://forum.lisk.io');
}
},
{
label: 'Report Issue',
click: function () {
electron.shell.openExternal('https://github.com/LiskHQ/lisk-nano/issues/new');
}
},
{
type: 'separator',
},
{
label: 'What\'s new',
click: function () {
electron.shell.openExternal('https://github.com/LiskHQ/lisk-nano/releases');
}
},
],
},
];

if (process.platform === 'darwin') {
Expand All @@ -60,23 +141,18 @@ function createWindow() {
],
});
} else {
template.push({
label: "Help",
submenu: [
{
label: 'About',
click: function (item, focusedWindow) {
if (focusedWindow) {
const options = {
buttons: ['OK'],
icon: `${__dirname}/assets/lisk.png`,
message: `Lisk Nano\nVersion ${app.getVersion()}\nCopyright © 2017 Lisk Foundation`,
}
electron.dialog.showMessageBox(focusedWindow, options, function () {})
}
template[template.length - 1].submenu.push({
label: 'About',
click: function (item, focusedWindow) {
if (focusedWindow) {
const options = {
buttons: ['OK'],
icon: `${__dirname}/assets/lisk.png`,
message: `Lisk Nano\nVersion ${app.getVersion()}\nCopyright © 2017 Lisk Foundation`,
}
electron.dialog.showMessageBox(focusedWindow, options, function () {})
}
]
}
});
}

Expand Down

0 comments on commit d3b73be

Please sign in to comment.