mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-07 22:18:33 +00:00
99 lines
2.2 KiB
JavaScript
99 lines
2.2 KiB
JavaScript
const { ipcMain } = require('electron');
|
|
const os = require('os');
|
|
const { BrowserWindow } = require('electron');
|
|
const { version } = require('../../package.json');
|
|
const aboutBruno = require('./about-bruno');
|
|
|
|
const template = [
|
|
{
|
|
label: 'Collection',
|
|
submenu: [
|
|
{
|
|
label: 'Open Collection',
|
|
click() {
|
|
ipcMain.emit('main:open-collection');
|
|
}
|
|
},
|
|
{
|
|
label: 'Open Recent',
|
|
role: 'recentdocuments',
|
|
visible: os.platform() == 'darwin',
|
|
submenu: [
|
|
{
|
|
label: 'Clear Recent',
|
|
role: 'clearrecentdocuments'
|
|
}
|
|
]
|
|
},
|
|
{
|
|
label: 'Preferences',
|
|
accelerator: 'CommandOrControl+,',
|
|
click() {
|
|
ipcMain.emit('main:open-preferences');
|
|
}
|
|
},
|
|
{ type: 'separator' },
|
|
{ role: 'quit' },
|
|
{
|
|
label: 'Force Quit',
|
|
click() {
|
|
process.exit();
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
label: 'Edit',
|
|
submenu: [
|
|
{ role: 'undo' },
|
|
{ role: 'redo' },
|
|
{ type: 'separator' },
|
|
{ role: 'cut' },
|
|
{ role: 'copy' },
|
|
{ role: 'paste' },
|
|
{ role: 'selectAll' },
|
|
{ type: 'separator' },
|
|
{ role: 'hide' },
|
|
{ role: 'hideOthers' }
|
|
]
|
|
},
|
|
{
|
|
label: 'View',
|
|
submenu: [
|
|
{ role: 'toggledevtools' },
|
|
{ type: 'separator' },
|
|
{ role: 'resetzoom' },
|
|
{ role: 'zoomin' },
|
|
{ role: 'zoomout' },
|
|
{ type: 'separator' },
|
|
{ role: 'togglefullscreen' }
|
|
]
|
|
},
|
|
{
|
|
role: 'window',
|
|
submenu: [{ role: 'minimize' }, { role: 'close', accelerator: 'CommandOrControl+Shift+Q' }]
|
|
},
|
|
{
|
|
role: 'help',
|
|
submenu: [
|
|
{
|
|
label: 'About Bruno',
|
|
click: () => {
|
|
const aboutWindow = new BrowserWindow({
|
|
width: 350,
|
|
height: 250,
|
|
webPreferences: {
|
|
nodeIntegration: true,
|
|
},
|
|
});
|
|
aboutWindow.removeMenu();
|
|
aboutWindow.loadURL(`data:text/html;charset=utf-8,${encodeURIComponent(aboutBruno({version}))}`);
|
|
}
|
|
},
|
|
{ label: 'Documentation', click: () => ipcMain.emit('main:open-docs') }
|
|
]
|
|
}
|
|
];
|
|
|
|
module.exports = template;
|