1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-17 15:37:57 +01:00

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", "name": "bitwarden",
"productName": "bitwarden", "productName": "Bitwarden",
"description": "A secure and free password manager for all of your devices.", "description": "A secure and free password manager for all of your devices.",
"version": "0.0.1", "version": "0.0.1",
"main": "main.js", "main": "main.js",

View File

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

View File

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