mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 15:10:06 +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 }
|
||||
)
|
||||
const canvasInfoEnabled = computed<boolean>(() =>
|
||||
settingStore.get('Comfy.Graph.CanvasInfo')
|
||||
)
|
||||
watch(
|
||||
canvasInfoEnabled,
|
||||
(newVal) => {
|
||||
if (comfyApp.canvas) comfyApp.canvas.show_info = newVal
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
let dropTargetCleanup = () => {}
|
||||
|
||||
@@ -72,6 +82,7 @@ onMounted(async () => {
|
||||
workspaceStore.spinner = true
|
||||
await comfyApp.setup(canvasRef.value)
|
||||
comfyApp.canvas.allow_searchbox = !nodeSearchEnabled.value
|
||||
comfyApp.canvas.show_info = canvasInfoEnabled.value
|
||||
workspaceStore.spinner = false
|
||||
|
||||
window['app'] = comfyApp
|
||||
|
||||
@@ -131,6 +131,13 @@ export const useSettingStore = defineStore('setting', {
|
||||
type: 'boolean',
|
||||
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]) {
|
||||
|
||||
Reference in New Issue
Block a user