mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
Add setting to show/hide canvas info (#533)
* Add setting to show/hide canvas info * nit
This commit is contained in:
@@ -52,6 +52,16 @@ watch(
|
|||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
const canvasInfoEnabled = computed<boolean>(() =>
|
||||||
|
settingStore.get('Comfy.Graph.CanvasInfo')
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
canvasInfoEnabled,
|
||||||
|
(newVal) => {
|
||||||
|
if (comfyApp.canvas) comfyApp.canvas.show_info = newVal
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
let dropTargetCleanup = () => {}
|
let dropTargetCleanup = () => {}
|
||||||
|
|
||||||
@@ -72,6 +82,7 @@ onMounted(async () => {
|
|||||||
workspaceStore.spinner = true
|
workspaceStore.spinner = true
|
||||||
await comfyApp.setup(canvasRef.value)
|
await comfyApp.setup(canvasRef.value)
|
||||||
comfyApp.canvas.allow_searchbox = !nodeSearchEnabled.value
|
comfyApp.canvas.allow_searchbox = !nodeSearchEnabled.value
|
||||||
|
comfyApp.canvas.show_info = canvasInfoEnabled.value
|
||||||
workspaceStore.spinner = false
|
workspaceStore.spinner = false
|
||||||
|
|
||||||
window['app'] = comfyApp
|
window['app'] = comfyApp
|
||||||
|
|||||||
@@ -131,6 +131,13 @@ export const useSettingStore = defineStore('setting', {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
defaultValue: false
|
defaultValue: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.ui.settings.addSetting({
|
||||||
|
id: 'Comfy.Graph.CanvasInfo',
|
||||||
|
name: 'Show canvas info (fps, etc.)',
|
||||||
|
type: 'boolean',
|
||||||
|
defaultValue: true
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
set<K extends keyof Settings>(key: K, value: Settings[K]) {
|
set<K extends keyof Settings>(key: K, value: Settings[K]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user