re-organize menu

This commit is contained in:
Kyle Spearrin 2018-02-10 17:07:46 -05:00
parent 88ce76a1d5
commit 692e5b7dbc
3 changed files with 35 additions and 25 deletions

View File

@ -1,6 +1,6 @@
{
"name": "bitwarden",
"productName": "bitwarden",
"productName": "Bitwarden",
"description": "A secure and free password manager for all of your devices.",
"version": "0.0.1",
"main": "main.js",

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>bitwarden</title>
<title>Bitwarden</title>
<base href="">
</head>
<body>

View File

@ -52,25 +52,15 @@ export class MenuMain {
},
],
},
{ type: 'separator' },
{
label: this.i18nService.t('addNewFolder'),
click: () => self.send('newFolder'),
},
{ type: 'separator' },
{
label: this.i18nService.t('settings'),
click: () => self.send('openSettings'),
},
{
label: this.i18nService.t('syncVault'),
click: () => self.send('syncVault'),
},
{
label: this.i18nService.t('lockNow'),
click: () => self.send('lockVault'),
accelerator: 'CmdOrCtrl+L',
},
],
},
{
@ -300,29 +290,49 @@ export class MenuMain {
},
];
const firstMenuOptions: MenuItemConstructorOptions[] = [
{ type: 'separator' },
{
label: this.i18nService.t('settings'),
click: () => self.send('openSettings'),
},
{
label: this.i18nService.t('lockNow'),
click: () => self.send('lockVault'),
accelerator: 'CmdOrCtrl+L',
},
];
if (process.platform === 'darwin') {
template[0].label = app.getName();
template[0].submenu = (template[0].submenu as MenuItemConstructorOptions[]).concat([
{ type: 'separator' },
const firstMenuPart: MenuItemConstructorOptions[] = [
{ role: 'about' },
{ type: 'separator' },
{ role: 'services', submenu: [] },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' },
]);
];
template.unshift({
label: 'Bitwarden',
submenu: firstMenuPart.concat(firstMenuOptions, [
{ type: 'separator' },
{ role: 'services', submenu: [] },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' },
]),
});
// Window menu
template[4].submenu = [
template[template.length - 2].submenu = [
{ role: 'close' },
{ role: 'minimize' },
{ role: 'zoom' },
{ type: 'separator' },
{ role: 'front' },
];
} else {
template[0].submenu = (template[0].submenu as MenuItemConstructorOptions[]).concat(
firstMenuOptions);
}
const menu = Menu.buildFromTemplate(template);