mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Updates hotkeys
This commit is contained in:
parent
aa96a457b6
commit
07ca0876ec
@ -54,10 +54,39 @@ const IAICanvasMaskButtonPopover = () => {
|
||||
[layer]
|
||||
);
|
||||
|
||||
useHotkeys(
|
||||
['shift+c'],
|
||||
() => {
|
||||
handleClearMask();
|
||||
},
|
||||
{
|
||||
enabled: () => true,
|
||||
preventDefault: true,
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
useHotkeys(
|
||||
['h'],
|
||||
() => {
|
||||
handleToggleEnableMask();
|
||||
},
|
||||
{
|
||||
enabled: () => true,
|
||||
preventDefault: true,
|
||||
},
|
||||
[isMaskEnabled]
|
||||
);
|
||||
|
||||
const handleToggleMaskLayer = () => {
|
||||
dispatch(setLayer(layer === 'mask' ? 'base' : 'mask'));
|
||||
};
|
||||
|
||||
const handleClearMask = () => dispatch(clearMask());
|
||||
|
||||
const handleToggleEnableMask = () =>
|
||||
dispatch(setIsMaskEnabled(!isMaskEnabled));
|
||||
|
||||
return (
|
||||
<IAIPopover
|
||||
trigger="hover"
|
||||
@ -72,11 +101,11 @@ const IAICanvasMaskButtonPopover = () => {
|
||||
}
|
||||
>
|
||||
<Flex direction={'column'} gap={'0.5rem'}>
|
||||
<IAIButton onClick={() => dispatch(clearMask())}>Clear Mask</IAIButton>
|
||||
<IAIButton onClick={handleClearMask}>Clear Mask</IAIButton>
|
||||
<IAICheckbox
|
||||
label="Enable Mask"
|
||||
isChecked={isMaskEnabled}
|
||||
onChange={(e) => dispatch(setIsMaskEnabled(e.target.checked))}
|
||||
onChange={handleToggleEnableMask}
|
||||
/>
|
||||
<IAICheckbox
|
||||
label="Preserve Masked Area"
|
||||
|
@ -69,7 +69,7 @@ const IAICanvasOutpaintingControls = () => {
|
||||
);
|
||||
|
||||
useHotkeys(
|
||||
['shift+r'],
|
||||
['r'],
|
||||
() => {
|
||||
handleResetCanvasView();
|
||||
},
|
||||
@ -80,18 +80,6 @@ const IAICanvasOutpaintingControls = () => {
|
||||
[canvasBaseLayer]
|
||||
);
|
||||
|
||||
useHotkeys(
|
||||
['shift+c'],
|
||||
() => {
|
||||
handleResetCanvas();
|
||||
},
|
||||
{
|
||||
enabled: () => true,
|
||||
preventDefault: true,
|
||||
},
|
||||
[canvasBaseLayer]
|
||||
);
|
||||
|
||||
useHotkeys(
|
||||
['shift+m'],
|
||||
() => {
|
||||
@ -241,8 +229,8 @@ const IAICanvasOutpaintingControls = () => {
|
||||
icon={<FaUpload />}
|
||||
/>
|
||||
<IAIIconButton
|
||||
aria-label="Reset Canvas View"
|
||||
tooltip="Reset Canvas View"
|
||||
aria-label="Reset Canvas View (R)"
|
||||
tooltip="Reset Canvas View (R)"
|
||||
icon={<FaCrosshairs />}
|
||||
onClick={handleResetCanvasView}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user