mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): hold shift to make nodes draggable from anywhere
This commit is contained in:
parent
0257b4a611
commit
30e45eaf47
@ -53,14 +53,14 @@ export const InvocationComponent = memo((props: NodeProps<InvocationValue>) => {
|
|||||||
description={template.description}
|
description={template.description}
|
||||||
/>
|
/>
|
||||||
<Flex
|
<Flex
|
||||||
className="nopan"
|
className={'nopan'}
|
||||||
sx={{
|
sx={{
|
||||||
|
cursor: 'auto',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
borderBottomRadius: 'md',
|
borderBottomRadius: 'md',
|
||||||
py: 2,
|
py: 2,
|
||||||
bg: 'base.200',
|
bg: 'base.200',
|
||||||
_dark: { bg: 'base.800' },
|
_dark: { bg: 'base.800' },
|
||||||
cursor: 'auto',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IAINodeOutputs nodeId={nodeId} outputs={outputs} template={template} />
|
<IAINodeOutputs nodeId={nodeId} outputs={outputs} template={template} />
|
||||||
|
@ -2,6 +2,8 @@ import { Box, useToken } from '@chakra-ui/react';
|
|||||||
import { NODE_MIN_WIDTH } from 'app/constants';
|
import { NODE_MIN_WIDTH } from 'app/constants';
|
||||||
|
|
||||||
import { PropsWithChildren } from 'react';
|
import { PropsWithChildren } from 'react';
|
||||||
|
import { DRAG_HANDLE_CLASSNAME } from '../hooks/useBuildInvocation';
|
||||||
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
|
|
||||||
type NodeWrapperProps = PropsWithChildren & {
|
type NodeWrapperProps = PropsWithChildren & {
|
||||||
selected: boolean;
|
selected: boolean;
|
||||||
@ -13,8 +15,11 @@ const NodeWrapper = (props: NodeWrapperProps) => {
|
|||||||
'dark-lg',
|
'dark-lg',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const shift = useAppSelector((state) => state.hotkeys.shift);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
|
className={shift ? DRAG_HANDLE_CLASSNAME : 'nopan'}
|
||||||
sx={{
|
sx={{
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
borderRadius: 'md',
|
borderRadius: 'md',
|
||||||
|
@ -23,7 +23,6 @@ const ProgressImageNode = (props: NodeProps<InvocationValue>) => {
|
|||||||
<Flex
|
<Flex
|
||||||
className="nopan"
|
className="nopan"
|
||||||
sx={{
|
sx={{
|
||||||
cursor: 'auto',
|
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
borderBottomRadius: 'md',
|
borderBottomRadius: 'md',
|
||||||
p: 2,
|
p: 2,
|
||||||
|
Loading…
Reference in New Issue
Block a user