mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-26 17:54:14 +00:00
Support associated socket for widgets (#891)
This PR is the litegraph side change necessary for widget sockets
feature in ComfyUI_frontend. Changes include
- Add readonly `Widget.computedDisabled` property for getting the
computed disabled state. When the associated socket is connected, the
widget is disabled
- Dynamically show the associated socket when
- the mouse is over the widget
- the slot is valid during link drop
- the slot is connected
- Removes the legacy widget drop behavior
Ref: https://github.com/Comfy-Org/rfcs/pull/9
This commit is contained in:
@@ -153,24 +153,38 @@ export interface IBaseWidget {
|
||||
/**
|
||||
* The computed height of the widget. Used by customized node resize logic.
|
||||
* See scripts/domWidget.ts for more details.
|
||||
* @readonly [Computed] This property is computed by the node.
|
||||
*/
|
||||
computedHeight?: number
|
||||
|
||||
/**
|
||||
* The starting y position of the widget after layout.
|
||||
* @readonly [Computed] This property is computed by the node.
|
||||
*/
|
||||
y: number
|
||||
|
||||
/**
|
||||
* The y position of the widget after drawing (rendering).
|
||||
* @readonly [Computed] This property is computed by the node.
|
||||
* @deprecated There is no longer dynamic y adjustment on rendering anymore.
|
||||
* Use {@link IBaseWidget.y} instead.
|
||||
*/
|
||||
last_y?: number
|
||||
|
||||
width?: number
|
||||
/**
|
||||
* Whether the widget is disabled. Disabled widgets are rendered at half opacity.
|
||||
* See also {@link IBaseWidget.computedDisabled}.
|
||||
*/
|
||||
disabled?: boolean
|
||||
|
||||
/**
|
||||
* The disabled state used for rendering based on various conditions including
|
||||
* {@link IBaseWidget.disabled}.
|
||||
* @readonly [Computed] This property is computed by the node.
|
||||
*/
|
||||
computedDisabled?: boolean
|
||||
|
||||
hidden?: boolean
|
||||
advanced?: boolean
|
||||
|
||||
|
||||
Reference in New Issue
Block a user