mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 00:08:11 +08:00
Refactor the WidgetLayout struct to remove SubLayout and avoid sending LayoutTarget to frontend
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
import { getContext, onMount, onDestroy } from "svelte";
|
||||
|
||||
import type { Editor } from "@graphite/editor";
|
||||
import { defaultWidgetLayout, patchWidgetLayout, UpdateDataPanelLayout } from "@graphite/messages";
|
||||
import { patchWidgetLayout, UpdateDataPanelLayout, type LayoutGroup } from "@graphite/messages";
|
||||
|
||||
import LayoutCol from "@graphite/components/layout/LayoutCol.svelte";
|
||||
import WidgetLayout from "@graphite/components/widgets/WidgetLayout.svelte";
|
||||
|
||||
const editor = getContext<Editor>("editor");
|
||||
|
||||
let dataPanelLayout = defaultWidgetLayout();
|
||||
let dataPanelLayout: LayoutGroup[] = [];
|
||||
|
||||
onMount(() => {
|
||||
editor.subscriptions.subscribeJsMessage(UpdateDataPanelLayout, (updateDataPanelLayout) => {
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<LayoutCol class="data-panel">
|
||||
<LayoutCol class="body" scrollableY={true}>
|
||||
<WidgetLayout layout={dataPanelLayout} />
|
||||
<WidgetLayout layout={dataPanelLayout} layoutTarget="DataPanel" />
|
||||
</LayoutCol>
|
||||
</LayoutCol>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user