diff --git a/ts/rgthree.ts b/ts/rgthree.ts index 5ef5670..1c7f089 100644 --- a/ts/rgthree.ts +++ b/ts/rgthree.ts @@ -4,6 +4,7 @@ import { app } from "../../scripts/app.js"; // @ts-ignore import {rgthreeConfig} from "./rgthree_config.js"; import { fixBadLinks } from "./link_fixer.js"; +import { wait } from "./utils.js"; export enum LogLevel { IMPORTANT = 1, @@ -223,6 +224,18 @@ class Rgthree { }, 100); loadGraphData && loadGraphData.call(app, ...arguments); } + + wait(100).then(() => { + this.injectRgthreeCss(); + }); + } + + private injectRgthreeCss() { + let link = document.createElement("link"); + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = 'extensions/rgthree-comfy/rgthree.css'; + document.head.appendChild(link); } private readonly eventsToFns = new Map void>>(); diff --git a/web/rgthree.css b/web/rgthree.css new file mode 100644 index 0000000..ac920b0 --- /dev/null +++ b/web/rgthree.css @@ -0,0 +1,15 @@ + +/* Fix node selector being crazy long b/c of array types. */ +.litegraph.litesearchbox input, +.litegraph.litesearchbox select { + max-width: 250px; +} + +/* There's no reason for this z-index to be so high. It layers on top of things it shouldn't, + (like pythongssss' image gallery, etc.) */ +.comfy-multiline-input { + z-index: 2 !important; +} +.comfy-multiline-input:focus { + z-index: 3 !important; +} \ No newline at end of file diff --git a/web/rgthree.js b/web/rgthree.js index ef0cd05..4c110df 100644 --- a/web/rgthree.js +++ b/web/rgthree.js @@ -1,6 +1,7 @@ import { app } from "../../scripts/app.js"; import { rgthreeConfig } from "./rgthree_config.js"; import { fixBadLinks } from "./link_fixer.js"; +import { wait } from "./utils.js"; export var LogLevel; (function (LogLevel) { LogLevel[LogLevel["IMPORTANT"] = 1] = "IMPORTANT"; @@ -193,6 +194,16 @@ class Rgthree { }, 100); loadGraphData && loadGraphData.call(app, ...arguments); }; + wait(100).then(() => { + this.injectRgthreeCss(); + }); + } + injectRgthreeCss() { + let link = document.createElement("link"); + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = 'extensions/rgthree-comfy/rgthree.css'; + document.head.appendChild(link); } addEventListener(event, fn) { if (!this.eventsToFns.has(event)) {