mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 01:18:12 +08:00
Unwrap the Layout enum to replace it with the WidgetLayout struct now called Layout (#3448)
This commit is contained in:
@@ -2,19 +2,19 @@
|
||||
import { getContext, onMount } from "svelte";
|
||||
|
||||
import type { Editor } from "@graphite/editor";
|
||||
import type { LayoutGroup } from "@graphite/messages";
|
||||
import { patchWidgetLayout, UpdateStatusBarHintsLayout } from "@graphite/messages";
|
||||
import type { Layout } from "@graphite/messages";
|
||||
import { patchLayout, UpdateStatusBarHintsLayout } from "@graphite/messages";
|
||||
|
||||
import LayoutRow from "@graphite/components/layout/LayoutRow.svelte";
|
||||
import WidgetLayout from "@graphite/components/widgets/WidgetLayout.svelte";
|
||||
|
||||
const editor = getContext<Editor>("editor");
|
||||
|
||||
let statusBarHintsLayout: LayoutGroup[] = [];
|
||||
let statusBarHintsLayout: Layout = [];
|
||||
|
||||
onMount(() => {
|
||||
editor.subscriptions.subscribeJsMessage(UpdateStatusBarHintsLayout, (updateStatusBarHintsLayout) => {
|
||||
patchWidgetLayout(statusBarHintsLayout, updateStatusBarHintsLayout);
|
||||
patchLayout(statusBarHintsLayout, updateStatusBarHintsLayout);
|
||||
statusBarHintsLayout = statusBarHintsLayout;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import { getContext, onMount } from "svelte";
|
||||
|
||||
import type { Editor } from "@graphite/editor";
|
||||
import type { LayoutGroup } from "@graphite/messages";
|
||||
import { patchWidgetLayout, UpdateMenuBarLayout } from "@graphite/messages";
|
||||
import type { Layout } from "@graphite/messages";
|
||||
import { patchLayout, UpdateMenuBarLayout } from "@graphite/messages";
|
||||
import type { AppWindowState } from "@graphite/state-providers/app-window";
|
||||
|
||||
import LayoutRow from "@graphite/components/layout/LayoutRow.svelte";
|
||||
@@ -15,11 +15,11 @@
|
||||
const appWindow = getContext<AppWindowState>("appWindow");
|
||||
const editor = getContext<Editor>("editor");
|
||||
|
||||
let menuBarLayout: LayoutGroup[] = [];
|
||||
let menuBarLayout: Layout = [];
|
||||
|
||||
onMount(() => {
|
||||
editor.subscriptions.subscribeJsMessage(UpdateMenuBarLayout, (updateMenuBarLayout) => {
|
||||
patchWidgetLayout(menuBarLayout, updateMenuBarLayout);
|
||||
patchLayout(menuBarLayout, updateMenuBarLayout);
|
||||
menuBarLayout = menuBarLayout;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user