mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
69 lines
1.7 KiB
JavaScript
69 lines
1.7 KiB
JavaScript
module.exports = commands => {
|
|
return {
|
|
label: 'View',
|
|
submenu: [
|
|
{
|
|
label: 'Reload',
|
|
accelerator: commands['window:reload'],
|
|
click(item, focusedWindow) {
|
|
if (focusedWindow) {
|
|
focusedWindow.rpc.emit('reload');
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: 'Full Reload',
|
|
accelerator: commands['window:reloadFull'],
|
|
click(item, focusedWindow) {
|
|
if (focusedWindow) {
|
|
focusedWindow.reload();
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: 'Developer Tools',
|
|
accelerator: commands['window:devtools'],
|
|
click(item, focusedWindow) {
|
|
if (focusedWindow) {
|
|
const webContents = focusedWindow.webContents;
|
|
if (webContents.isDevToolsOpened()) {
|
|
webContents.closeDevTools();
|
|
} else {
|
|
webContents.openDevTools({mode: 'detach'});
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type: 'separator'
|
|
},
|
|
{
|
|
label: 'Reset Zoom Level',
|
|
accelerator: commands['zoom:reset'],
|
|
click(item, focusedWindow) {
|
|
if (focusedWindow) {
|
|
focusedWindow.rpc.emit('reset fontSize req');
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: 'Zoom In',
|
|
accelerator: commands['zoom:in'],
|
|
click(item, focusedWindow) {
|
|
if (focusedWindow) {
|
|
focusedWindow.rpc.emit('increase fontSize req');
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: 'Zoom Out',
|
|
accelerator: commands['zoom:out'],
|
|
click(item, focusedWindow) {
|
|
if (focusedWindow) {
|
|
focusedWindow.rpc.emit('decrease fontSize req');
|
|
}
|
|
}
|
|
}
|
|
]
|
|
};
|
|
};
|