Add a keyboard shortcut to toggle hidden event visibility when labs are enabled. (#7584)
Notes: The keyboard shortcut is control (or cmd) shift h. Signed-off-by: Katarzyna Stachura <uwunyaa@outlook.com>
This commit is contained in:
parent
00912c0b50
commit
debf4caade
6 changed files with 82 additions and 3 deletions
|
@ -22,9 +22,11 @@ import {
|
|||
NavigationAction,
|
||||
RoomAction,
|
||||
RoomListAction,
|
||||
LabsAction,
|
||||
} from "./KeyBindingsManager";
|
||||
import { isMac, Key } from "./Keyboard";
|
||||
import SettingsStore from "./settings/SettingsStore";
|
||||
import SdkConfig from "./SdkConfig";
|
||||
|
||||
const messageComposerBindings = (): KeyBinding<MessageComposerAction>[] => {
|
||||
const bindings: KeyBinding<MessageComposerAction>[] = [
|
||||
|
@ -411,10 +413,28 @@ const navigationBindings = (): KeyBinding<NavigationAction>[] => {
|
|||
];
|
||||
};
|
||||
|
||||
const labsBindings = (): KeyBinding<LabsAction>[] => {
|
||||
if (!SdkConfig.get()['showLabsSettings']) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
action: LabsAction.ToggleHiddenEventVisibility,
|
||||
keyCombo: {
|
||||
key: Key.H,
|
||||
ctrlOrCmd: true,
|
||||
shiftKey: true,
|
||||
},
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
export const defaultBindingsProvider: IKeyBindingsProvider = {
|
||||
getMessageComposerBindings: messageComposerBindings,
|
||||
getAutocompleteBindings: autocompleteBindings,
|
||||
getRoomListBindings: roomListBindings,
|
||||
getRoomBindings: roomBindings,
|
||||
getNavigationBindings: navigationBindings,
|
||||
getLabsBindings: labsBindings,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue