Replace locking/unlocking of canvas with select/pan mode (#1050)

* Add dragging canvas state

* Change icon

* Add playwright test

* tooltip change

* Enable for legacy menu

* Update litegraph

* Hide canvas menu for test
This commit is contained in:
Chenlei Hu
2024-09-30 20:20:49 -04:00
committed by GitHub
parent f75f774ddb
commit 5d957a05b9
8 changed files with 69 additions and 11 deletions

View File

@@ -13,6 +13,7 @@ export const useTitleEditorStore = defineStore('titleEditor', () => {
export const useCanvasStore = defineStore('canvas', () => {
const canvas = shallowRef<LGraphCanvas | null>(null)
const readOnly = ref(false)
const draggingCanvas = ref(false)
document.addEventListener(
'litegraph:canvas',
@@ -23,8 +24,18 @@ export const useCanvasStore = defineStore('canvas', () => {
}
)
document.addEventListener(
'litegraph:canvas',
(e: CustomEvent<{ subType: string; draggingCanvas: boolean }>) => {
if (e.detail?.subType === 'dragging-canvas') {
draggingCanvas.value = e.detail.draggingCanvas
}
}
)
return {
canvas,
readOnly
readOnly,
draggingCanvas
}
})