mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 12:38:11 +08:00
Plumb layer panel (#107)
* WIP ExpandFolder handling * Implement response parsing in typescript * Update layer panel with list sent by wasm * Add events for layer interaction * Add proper default naming * Fix displaying of the eye icon * Attach path to LayerPanelEntry * Fix lint issues Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
76d3e8cde4
commit
6adb984f2d
@@ -180,7 +180,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { ResponseType, registerResponseHandler } from "../../response-handler";
|
||||
import { ResponseType, registerResponseHandler, Response, UpdateCanvas, SetActiveTool } from "../../response-handler";
|
||||
import LayoutRow from "../layout/LayoutRow.vue";
|
||||
import LayoutCol from "../layout/LayoutCol.vue";
|
||||
import ShelfItem from "../widgets/ShelfItem.vue";
|
||||
@@ -324,13 +324,13 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
registerResponseHandler(ResponseType["Tool::UpdateCanvas"], (responseData: any) => {
|
||||
this.viewportSvg = responseData.Tool.UpdateCanvas.document;
|
||||
registerResponseHandler(ResponseType.UpdateCanvas, (responseData: Response) => {
|
||||
const updateData = responseData as UpdateCanvas;
|
||||
if (updateData) this.viewportSvg = updateData.document;
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
registerResponseHandler(ResponseType["Tool::SetActiveTool"], (responseData: any) => {
|
||||
this.activeTool = responseData.Tool.SetActiveTool.tool_name;
|
||||
registerResponseHandler(ResponseType.SetActiveTool, (responseData: Response) => {
|
||||
const toolData = responseData as SetActiveTool;
|
||||
if (toolData) this.activeTool = toolData.tool_name;
|
||||
});
|
||||
|
||||
window.addEventListener("keyup", (e: KeyboardEvent) => this.keyUp(e));
|
||||
|
||||
Reference in New Issue
Block a user