mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 07:18:12 +08:00
Refactor the WidgetLayout struct to remove SubLayout and avoid sending LayoutTarget to frontend
This commit is contained in:
@@ -4,7 +4,6 @@ import { writable } from "svelte/store";
|
||||
import { type Editor } from "@graphite/editor";
|
||||
|
||||
import {
|
||||
defaultWidgetLayout,
|
||||
patchWidgetLayout,
|
||||
UpdateDocumentBarLayout,
|
||||
UpdateDocumentModeLayout,
|
||||
@@ -14,17 +13,18 @@ import {
|
||||
UpdateNodeGraphControlBarLayout,
|
||||
UpdateGraphViewOverlay,
|
||||
UpdateGraphFadeArtwork,
|
||||
type LayoutGroup,
|
||||
} from "@graphite/messages";
|
||||
|
||||
export function createDocumentState(editor: Editor) {
|
||||
const state = writable({
|
||||
// Layouts
|
||||
documentModeLayout: defaultWidgetLayout(),
|
||||
toolOptionsLayout: defaultWidgetLayout(),
|
||||
documentBarLayout: defaultWidgetLayout(),
|
||||
toolShelfLayout: defaultWidgetLayout(),
|
||||
workingColorsLayout: defaultWidgetLayout(),
|
||||
nodeGraphControlBarLayout: defaultWidgetLayout(),
|
||||
documentModeLayout: [] as LayoutGroup[],
|
||||
toolOptionsLayout: [] as LayoutGroup[],
|
||||
documentBarLayout: [] as LayoutGroup[],
|
||||
toolShelfLayout: [] as LayoutGroup[],
|
||||
workingColorsLayout: [] as LayoutGroup[],
|
||||
nodeGraphControlBarLayout: [] as LayoutGroup[],
|
||||
// Graph view overlay
|
||||
graphViewOverlayOpen: false,
|
||||
fadeArtwork: 100,
|
||||
|
||||
Reference in New Issue
Block a user