From 42f6f12ceb7f06276cc77a28bba3d07ef298c30c Mon Sep 17 00:00:00 2001 From: space-nuko <24979496+space-nuko@users.noreply.github.com> Date: Sat, 29 Apr 2023 13:08:59 -0700 Subject: [PATCH] Fixing UI editing mode --- src/lib/components/ComfyApp.svelte | 7 +- src/lib/components/ComfyUIPane.svelte | 4 -- src/lib/components/WidgetContainer.svelte | 85 ++++++++++++++++------- src/lib/stores/layoutState.ts | 3 + src/lib/stores/uiState.ts | 6 +- 5 files changed, 74 insertions(+), 31 deletions(-) diff --git a/src/lib/components/ComfyApp.svelte b/src/lib/components/ComfyApp.svelte index b13a927..8f711da 100644 --- a/src/lib/components/ComfyApp.svelte +++ b/src/lib/components/ComfyApp.svelte @@ -169,7 +169,12 @@ - + + diff --git a/src/lib/components/ComfyUIPane.svelte b/src/lib/components/ComfyUIPane.svelte index c06972d..dd0cf7d 100644 --- a/src/lib/components/ComfyUIPane.svelte +++ b/src/lib/components/ComfyUIPane.svelte @@ -53,8 +53,4 @@ } - #comfy-ui-panes > :global(.root-container > .block) { - padding: 0px; - } - diff --git a/src/lib/components/WidgetContainer.svelte b/src/lib/components/WidgetContainer.svelte index ce554a1..65b51ea 100644 --- a/src/lib/components/WidgetContainer.svelte +++ b/src/lib/components/WidgetContainer.svelte @@ -14,14 +14,15 @@ import { getComponentForWidgetState } from "$lib/utils" export let dragItem: IDragItem | null = null; - export let zIndex: number = 100; + export let zIndex: number = 0; export let classes: string[] = []; + export let isRoot: boolean = false; + let dragDisabled: boolean = false; let container: ContainerLayout | null = null; let widget: WidgetLayout | null = null; let widgetState: WidgetUIState | null = null; let children: IDragItem[] | null = null; - let dragDisabled = true; - const flipDurationMs = 200; + const flipDurationMs = 100; $: if (dragItem) { if (dragItem.type === "container") { @@ -37,8 +38,6 @@ } } - $: dragDisabled = !$uiState.unlocked; - function handleConsider(evt: any) { children = layoutState.updateChildren(dragItem, evt.detail.items) // console.log(dragItems); @@ -47,18 +46,13 @@ function handleFinalize(evt: any) { children = layoutState.updateChildren(dragItem, evt.detail.items) // Ensure dragging is stopped on drag finish - // dragDisabled = true; }; const startDrag = () => { - if (!$uiState.unlocked) - return - // dragDisabled = false; + return }; const stopDrag = () => { - if (!$uiState.unlocked) - return - // dragDisabled = true; + return }; $: if ($queueState && widget) { @@ -70,12 +64,14 @@ {#if container && children} {@const id = container.id} -
+
1}> {#if container.attrs.showTitle} -