mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add a Shortcut for Toggling Shape Lock (#1005)
* Update shortcuts.md for Lock * Add 'Q' as a shortcut for toggling shape lock * Add shortcut to LockIcon title * use event.key instead Co-authored-by: Faustino Kialungila <Faustino.kialungila@gmail.com>
This commit is contained in:
parent
cb68153a81
commit
cb66adc716
4 changed files with 21 additions and 12 deletions
|
@ -33,6 +33,7 @@ interface LayerUIProps {
|
|||
setElements: (elements: readonly ExcalidrawElement[]) => void;
|
||||
onRoomCreate: () => void;
|
||||
onRoomDestroy: () => void;
|
||||
onToggleLock: () => void;
|
||||
}
|
||||
|
||||
export const LayerUI = React.memo(
|
||||
|
@ -46,6 +47,7 @@ export const LayerUI = React.memo(
|
|||
setElements,
|
||||
onRoomCreate,
|
||||
onRoomDestroy,
|
||||
onToggleLock,
|
||||
}: LayerUIProps) => {
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
|
@ -157,14 +159,7 @@ export const LayerUI = React.memo(
|
|||
</Island>
|
||||
<LockIcon
|
||||
checked={appState.elementLocked}
|
||||
onChange={() => {
|
||||
setAppState({
|
||||
elementLocked: !appState.elementLocked,
|
||||
elementType: appState.elementLocked
|
||||
? "selection"
|
||||
: appState.elementType,
|
||||
});
|
||||
}}
|
||||
onChange={onToggleLock}
|
||||
title={t("toolBar.lock")}
|
||||
isButton={isMobile}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue