From 1bec3154276a6219d2a87fe22e5e6b719dafec07 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:16:52 +0000 Subject: [PATCH] Adds highlight to advanced widgets (#317) * Adds highlight to advanced widgets * Update snapshot --- src/LGraphCanvas.ts | 2 +- src/LiteGraphGlobal.ts | 1 + test/__snapshots__/litegraph.test.ts.snap | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index d0e3fe996..1efd11fd6 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -5665,7 +5665,6 @@ export class LGraphCanvas { const show_text = this.ds.scale > 0.5 ctx.save() ctx.globalAlpha = this.editor_alpha - const outline_color = LiteGraph.WIDGET_OUTLINE_COLOR const background_color = LiteGraph.WIDGET_BGCOLOR const text_color = LiteGraph.WIDGET_TEXT_COLOR const secondary_text_color = LiteGraph.WIDGET_SECONDARY_TEXT_COLOR @@ -5675,6 +5674,7 @@ export class LGraphCanvas { const w = widgets[i] if (w.hidden || (w.advanced && !node.showAdvanced)) continue const y = w.y || posY + const outline_color = w.advanced ? LiteGraph.WIDGET_ADVANCED_OUTLINE_COLOR : LiteGraph.WIDGET_OUTLINE_COLOR if (w === this.link_over_widget) { ctx.fillStyle = this.default_connection_color_byType[this.link_over_widget_type] || diff --git a/src/LiteGraphGlobal.ts b/src/LiteGraphGlobal.ts index ac523aefc..d4bb859a0 100644 --- a/src/LiteGraphGlobal.ts +++ b/src/LiteGraphGlobal.ts @@ -51,6 +51,7 @@ export class LiteGraphGlobal { WIDGET_BGCOLOR = "#222" WIDGET_OUTLINE_COLOR = "#666" + WIDGET_ADVANCED_OUTLINE_COLOR = "rgba(56, 139, 253, 0.8)" WIDGET_TEXT_COLOR = "#DDD" WIDGET_SECONDARY_TEXT_COLOR = "#999" diff --git a/test/__snapshots__/litegraph.test.ts.snap b/test/__snapshots__/litegraph.test.ts.snap index e9f351247..3b3929029 100644 --- a/test/__snapshots__/litegraph.test.ts.snap +++ b/test/__snapshots__/litegraph.test.ts.snap @@ -127,6 +127,7 @@ LiteGraphGlobal { ], "VERSION": 0.4, "VERTICAL_LAYOUT": "vertical", + "WIDGET_ADVANCED_OUTLINE_COLOR": "rgba(56, 139, 253, 0.8)", "WIDGET_BGCOLOR": "#222", "WIDGET_OUTLINE_COLOR": "#666", "WIDGET_SECONDARY_TEXT_COLOR": "#999",