mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-26 01:34:07 +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:
@@ -64,7 +64,7 @@ export class NumberWidget extends BaseWidget implements INumericWidget {
|
||||
ctx.fill()
|
||||
|
||||
if (show_text) {
|
||||
if (!this.disabled) {
|
||||
if (!this.computedDisabled) {
|
||||
ctx.stroke()
|
||||
// Draw left arrow
|
||||
ctx.fillStyle = this.text_color
|
||||
|
||||
Reference in New Issue
Block a user