Skip to content

Commit

Permalink
Add node tooltip delay setting (#2396)
Browse files Browse the repository at this point in the history
Co-authored-by: Chenlei Hu <[email protected]>
  • Loading branch information
webfiltered and huchenlei authored Feb 2, 2025
1 parent 5f59fbd commit 57bc7ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/graph/NodeTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ import { nextTick, ref } from 'vue'
import { st } from '@/i18n'
import { app as comfyApp } from '@/scripts/app'
import { useNodeDefStore } from '@/stores/nodeDefStore'
import { useSettingStore } from '@/stores/settingStore'
import { normalizeI18nKey } from '@/utils/formatUtil'
let idleTimeout: number
const nodeDefStore = useNodeDefStore()
const settingStore = useSettingStore()
const tooltipRef = ref<HTMLDivElement>()
const tooltipText = ref('')
const left = ref<string>()
Expand Down Expand Up @@ -110,7 +112,10 @@ const onMouseMove = (e: MouseEvent) => {
clearTimeout(idleTimeout)
if ((e.target as Node).nodeName !== 'CANVAS') return
idleTimeout = window.setTimeout(onIdle, 500)
idleTimeout = window.setTimeout(
onIdle,
settingStore.get('LiteGraph.Node.TooltipDelay')
)
}
useEventListener(window, 'mousemove', onMouseMove)
Expand Down
12 changes: 12 additions & 0 deletions src/constants/coreSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,18 @@ export const CORE_SETTINGS: SettingParams[] = [
},
defaultValue: 0
},
{
id: 'LiteGraph.Node.TooltipDelay',
name: 'Tooltip Delay',
type: 'number',
attrs: {
min: 100,
max: 3000,
step: 50
},
defaultValue: 500,
versionAdded: '1.9.0'
},
{
id: 'Comfy.EnableTooltips',
category: ['LiteGraph', 'Node', 'EnableTooltips'],
Expand Down

0 comments on commit 57bc7ad

Please sign in to comment.