mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 05:49:54 +00:00
Add setting to disable double click node title edit (#668)
This commit is contained in:
@@ -15,6 +15,9 @@ import { LGraphNode } from '@comfyorg/litegraph'
|
||||
import { ComfyExtension } from '@/types/comfy'
|
||||
import EditableText from '@/components/common/EditableText.vue'
|
||||
import { LiteGraph } from '@comfyorg/litegraph'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
|
||||
const settingStore = useSettingStore()
|
||||
|
||||
const showInput = ref(false)
|
||||
const editedTitle = ref('')
|
||||
@@ -43,6 +46,10 @@ const extension: ComfyExtension = {
|
||||
const originalCallback = node.onNodeTitleDblClick
|
||||
|
||||
node.onNodeTitleDblClick = function (e: MouseEvent, ...args: any[]) {
|
||||
if (!settingStore.get('Comfy.Node.DoubleClickTitleToEdit')) {
|
||||
return
|
||||
}
|
||||
|
||||
currentNode.value = this
|
||||
editedTitle.value = this.title
|
||||
showInput.value = true
|
||||
|
||||
@@ -252,6 +252,13 @@ export const useSettingStore = defineStore('setting', {
|
||||
max: 100
|
||||
}
|
||||
})
|
||||
|
||||
app.ui.settings.addSetting({
|
||||
id: 'Comfy.Node.DoubleClickTitleToEdit',
|
||||
name: 'Double click node title to edit',
|
||||
type: 'boolean',
|
||||
defaultValue: true
|
||||
})
|
||||
},
|
||||
|
||||
set<K extends keyof Settings>(key: K, value: Settings[K]) {
|
||||
|
||||
@@ -465,7 +465,8 @@ const zSettings = z.record(z.any()).and(
|
||||
'Comfy.Workflow.SortNodeIdOnSave': z.boolean(),
|
||||
'Comfy.Queue.ImageFit': z.enum(['contain', 'cover']),
|
||||
'Comfy.Workflow.ModelDownload.AllowedSources': z.array(z.string()),
|
||||
'Comfy.Workflow.ModelDownload.AllowedSuffixes': z.array(z.string())
|
||||
'Comfy.Workflow.ModelDownload.AllowedSuffixes': z.array(z.string()),
|
||||
'Comfy.Node.DoubleClickTitleToEdit': z.boolean()
|
||||
})
|
||||
.optional()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user