Revert "Support associated socket for widgets" (#896)

Reverts Comfy-Org/litegraph.js#891

Temporary revert to unblock other PRs (causing test failures; frontend
PR for this has not yet been merged).
This commit is contained in:
filtered
2025-04-06 22:38:18 +10:00
committed by GitHub
parent 981979335e
commit ee625b4112
12 changed files with 53 additions and 77 deletions

View File

@@ -23,7 +23,6 @@ export abstract class BaseWidget implements IBaseWidget {
last_y?: number
width?: number
disabled?: boolean
computedDisabled?: boolean
hidden?: boolean
advanced?: boolean
tooltip?: string

View File

@@ -33,7 +33,7 @@ export class BooleanWidget extends BaseWidget implements IBooleanWidget {
ctx.roundRect(margin, y, width - margin * 2, height, [height * 0.5])
else ctx.rect(margin, y, width - margin * 2, height)
ctx.fill()
if (show_text && !this.computedDisabled) ctx.stroke()
if (show_text && !this.disabled) ctx.stroke()
ctx.fillStyle = this.value ? "#89A" : "#333"
ctx.beginPath()
ctx.arc(

View File

@@ -45,7 +45,7 @@ export class ButtonWidget extends BaseWidget implements IButtonWidget {
ctx.fillRect(margin, y, width - margin * 2, height)
// Draw button outline if not disabled
if (show_text && !this.computedDisabled) {
if (show_text && !this.disabled) {
ctx.strokeStyle = this.outline_color
ctx.strokeRect(margin, y, width - margin * 2, height)
}

View File

@@ -49,7 +49,7 @@ export class ComboWidget extends BaseWidget implements IComboWidget {
ctx.fill()
if (show_text) {
if (!this.computedDisabled) {
if (!this.disabled) {
ctx.stroke()
// Draw left arrow
ctx.fillStyle = this.text_color

View File

@@ -158,7 +158,7 @@ export class KnobWidget extends BaseWidget implements IKnobWidget {
ctx.closePath()
// Draw outline if not disabled
if (show_text && !this.computedDisabled) {
if (show_text && !this.disabled) {
ctx.strokeStyle = this.outline_color
// Draw value
ctx.beginPath()

View File

@@ -64,7 +64,7 @@ export class NumberWidget extends BaseWidget implements INumericWidget {
ctx.fill()
if (show_text) {
if (!this.computedDisabled) {
if (!this.disabled) {
ctx.stroke()
// Draw left arrow
ctx.fillStyle = this.text_color

View File

@@ -54,7 +54,7 @@ export class SliderWidget extends BaseWidget implements ISliderWidget {
ctx.fillRect(margin, y, nvalue * (width - margin * 2), height)
// Draw outline if not disabled
if (show_text && !this.computedDisabled) {
if (show_text && !this.disabled) {
ctx.strokeStyle = this.outline_color
ctx.strokeRect(margin, y, width - margin * 2, height)
}

View File

@@ -47,7 +47,7 @@ export class TextWidget extends BaseWidget implements IStringWidget {
ctx.fill()
if (show_text) {
if (!this.computedDisabled) ctx.stroke()
if (!this.disabled) ctx.stroke()
ctx.save()
ctx.beginPath()
ctx.rect(margin, y, width - margin * 2, height)