Sidebar toggle hotkey now configurable (Closes #1715)

This commit is contained in:
Gregory Schier committed 2019-12-13 23:11:13 -05:00
1 parent f4790965e3
commit 5f2f319e5b
4 files changed
+14 -1

No files matched your search

@@ -135,6 +135,8 @@ export const hotKeyRefs = {
SIDEBAR_FOCUS_FILTER: defineHotKey('sidebar_focusFilter', 'Filter Sidebar'),
SIDEBAR_TOGGLE: defineHotKey('sidebar_toggle', 'Toggle Sidebar'),
RESPONSE_FOCUS: defineHotKey('response_focus', 'Focus Response'),
SHOW_COOKIES_EDITOR: defineHotKey('showCookiesEditor', 'Edit Cookies'),
@@ -265,6 +267,11 @@ const defaultRegistry: HotKeyRegistry = {
keyComb(true, false, true, false, keyboardKeys.f.keyCode),
),
[hotKeyRefs.SIDEBAR_TOGGLE.id]: keyBinds(
keyComb(false, false, false, true, keyboardKeys.backslash.keyCode),
keyComb(true, false, false, false, keyboardKeys.backslash.keyCode),
),
[hotKeyRefs.RESPONSE_FOCUS.id]: keyBinds(
keyComb(false, false, false, true, keyboardKeys.singlequote.keyCode),
keyComb(true, false, false, false, keyboardKeys.singlequote.keyCode),
@@ -207,7 +207,6 @@ export function createWindow() {
},
{
label: 'Toggle Sidebar',
accelerator: 'CmdOrCtrl+\\',
click: () => {
const w = BrowserWindow.getFocusedWindow();
if (!w || !w.webContents) {
@@ -42,6 +42,7 @@ const HOT_KEY_DEFS: Array<HotKeyDefinition> = [
hotKeyRefs.RESPONSE_FOCUS,
hotKeyRefs.REQUEST_TOGGLE_HTTP_METHOD_MENU,
hotKeyRefs.SIDEBAR_FOCUS_FILTER,
hotKeyRefs.SIDEBAR_TOGGLE,
hotKeyRefs.REQUEST_TOGGLE_HISTORY,
hotKeyRefs.SHOW_AUTOCOMPLETE,
hotKeyRefs.PREFERENCES_SHOW_GENERAL,
@@ -252,6 +252,12 @@ class App extends PureComponent {
await this._updateIsVariableUncovered();
},
],
[
hotKeyRefs.SIDEBAR_TOGGLE,
() => {
this._handleToggleSidebar();
},
],
];
}