mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Better menus
This commit is contained in:
parent
8688a9c920
commit
8f77b18b21
133
app/app.js
133
app/app.js
@ -70,66 +70,91 @@ app.on('ready', () => {
|
||||
mainWindow = null;
|
||||
});
|
||||
|
||||
var template = [{
|
||||
label: "Application",
|
||||
submenu: [
|
||||
{label: "About Application", selector: "orderFrontStandardAboutPanel:"},
|
||||
{type: "separator"},
|
||||
{
|
||||
label: "Quit",
|
||||
accelerator: "Command+Q",
|
||||
click: function () {
|
||||
app.quit();
|
||||
var template = [
|
||||
{
|
||||
label: "Application",
|
||||
role: "window",
|
||||
submenu: [
|
||||
{label: "About Application", selector: "orderFrontStandardAboutPanel:"},
|
||||
{type: "separator"},
|
||||
{
|
||||
label: "Quit",
|
||||
accelerator: "Command+Q",
|
||||
click: function () {
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {
|
||||
label: "Edit",
|
||||
submenu: [
|
||||
{label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:"},
|
||||
{label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:"},
|
||||
{type: "separator"},
|
||||
{label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:"},
|
||||
{label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:"},
|
||||
{label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:"},
|
||||
{label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:"}
|
||||
]
|
||||
}, {
|
||||
label: "View",
|
||||
submenu: [
|
||||
{
|
||||
label: "Actual Size",
|
||||
accelerator: "CmdOrCtrl+0",
|
||||
click: () => {
|
||||
const window = electron.BrowserWindow.getFocusedWindow();
|
||||
zoomFactor = 1;
|
||||
window.webContents.setZoomFactor(zoomFactor);
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "Edit",
|
||||
submenu: [
|
||||
{label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:"},
|
||||
{label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:"},
|
||||
{type: "separator"},
|
||||
{label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:"},
|
||||
{label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:"},
|
||||
{label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:"},
|
||||
{label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:"}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "View",
|
||||
role: "window",
|
||||
submenu: [
|
||||
{
|
||||
label: "Actual Size",
|
||||
accelerator: "CmdOrCtrl+0",
|
||||
click: () => {
|
||||
const window = electron.BrowserWindow.getFocusedWindow();
|
||||
zoomFactor = 1;
|
||||
window.webContents.setZoomFactor(zoomFactor);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Zoom In",
|
||||
accelerator: "CmdOrCtrl+Plus",
|
||||
click: () => {
|
||||
const window = electron.BrowserWindow.getFocusedWindow();
|
||||
zoomFactor = Math.min(1.8, zoomFactor + 0.1);
|
||||
window.webContents.setZoomFactor(zoomFactor);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Zoom Out",
|
||||
accelerator: "CmdOrCtrl+-",
|
||||
click: () => {
|
||||
const window = electron.BrowserWindow.getFocusedWindow();
|
||||
zoomFactor = Math.max(0.5, zoomFactor - 0.1);
|
||||
window.webContents.setZoomFactor(zoomFactor);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Zoom In",
|
||||
accelerator: "CmdOrCtrl+Plus",
|
||||
click: () => {
|
||||
const window = electron.BrowserWindow.getFocusedWindow();
|
||||
zoomFactor = Math.min(1.8, zoomFactor + 0.1);
|
||||
window.webContents.setZoomFactor(zoomFactor);
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "Help",
|
||||
role: "help",
|
||||
submenu: [
|
||||
{
|
||||
label: "Report an Issue...",
|
||||
click: () => {
|
||||
electron.shell.openExternal('mailto:support@insomnia.rest');
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Insomnia Help",
|
||||
accelerator: "CmdOrCtrl+?",
|
||||
click: () => {
|
||||
electron.shell.openExternal('http://insomnia.rest');
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Zoom Out",
|
||||
accelerator: "CmdOrCtrl+-",
|
||||
click: () => {
|
||||
const window = electron.BrowserWindow.getFocusedWindow();
|
||||
zoomFactor = Math.max(0.5, zoomFactor - 0.1);
|
||||
window.webContents.setZoomFactor(zoomFactor);
|
||||
}
|
||||
}
|
||||
]
|
||||
}];
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
if (IS_DEV) {
|
||||
template.push({
|
||||
label: 'View',
|
||||
label: 'Developer',
|
||||
submenu: [{
|
||||
label: 'Reload',
|
||||
accelerator: 'Command+R',
|
||||
|
@ -98,13 +98,13 @@ class Sidebar extends Component {
|
||||
{this._renderChildren(children)}
|
||||
</ul>
|
||||
|
||||
<footer className="sidebar__footer form-control form-control--underlined">
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Filter Requests"
|
||||
value={filter}
|
||||
onChange={this._onFilterChange.bind(this)}/>
|
||||
</footer>
|
||||
{/*<footer className="sidebar__footer form-control form-control--underlined">*/}
|
||||
{/*<Input*/}
|
||||
{/*type="text"*/}
|
||||
{/*placeholder="Filter Requests"*/}
|
||||
{/*value={filter}*/}
|
||||
{/*onChange={this._onFilterChange.bind(this)}/>*/}
|
||||
{/*</footer>*/}
|
||||
</aside>
|
||||
)
|
||||
}
|
||||
|
@ -124,12 +124,6 @@
|
||||
padding-right: $padding-sm;
|
||||
}
|
||||
|
||||
// put border on folders
|
||||
|
||||
.sidebar__row:not(:first-child) .sidebar__item--big {
|
||||
border-top: 1px solid $hl-sm;
|
||||
}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~ //
|
||||
// Sidebar Clickable //
|
||||
// ~~~~~~~~~~~~~~~~~ //
|
||||
|
Loading…
Reference in New Issue
Block a user