diff --git a/src_web/comfyui/rgthree.scss b/src_web/comfyui/rgthree.scss index 883549e..db3780c 100644 --- a/src_web/comfyui/rgthree.scss +++ b/src_web/comfyui/rgthree.scss @@ -260,18 +260,28 @@ rgthree-progress-bar { box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.25), 0px 1px 0px rgba(255, 255, 255, 0.125); + } -* ~ rgthree-progress-bar { +* ~ rgthree-progress-bar, +.comfyui-body-bottom rgthree-progress-bar { box-shadow: - inset 0px 1px 0px rgba(0, 0, 0, 1), - inset 0px 2px 0px rgba(255, 255, 255, 0.15), inset 0px -1px 0px rgba(0, 0, 0, 0.25), 0px 1px 0px rgba(255, 255, 255, 0.125); + 0px -1px 0px rgba(0, 0, 0, 1), + inset 0px 1px 0px rgba(255, 255, 255, 0.15), inset 0px -1px 0px rgba(0, 0, 0, 0.25), 0px 1px 0px rgba(255, 255, 255, 0.125); } body > rgthree-progress-bar { position: fixed; } +// When ComfyUI added the top/bottom bar for their UI in beta, they added markup for the grid +// display, but they only actually apply a grid display when the bar is enabled. This doesn't allow +// us (or other extensions) to start using the new layout... so we'll force it to be grid always +// (when we add our class, which we do when we add the rgthree-comfy progress bar). +body.rgthree-force-new-comfyui-grid-layout { + display: grid; +} + .rgthree-debug-keydowns { display: block; position: fixed; diff --git a/src_web/comfyui/rgthree.ts b/src_web/comfyui/rgthree.ts index c0d6d38..abd256a 100644 --- a/src_web/comfyui/rgthree.ts +++ b/src_web/comfyui/rgthree.ts @@ -314,7 +314,7 @@ class Rgthree extends EventTarget { this.progressBarEl = RgthreeProgressBar.create(); this.progressBarEl.setAttribute( "title", - "Progress Bar by gthree. (Right-click for rgthree menu)", + "Progress Bar by rgthree. right-click for rgthree menu.", ); this.progressBarEl.addEventListener("contextmenu", async (e) => { @@ -358,6 +358,9 @@ class Rgthree extends EventTarget { const position = CONFIG_SERVICE.getConfigValue("features.progress_bar.position"); // If ComfyUI is updated with the body segments, then use that. if (isUpdatedComfyBodyClasses) { + // Looks like ComfyUI sets up the markup for its new grid layout, but only actually applies + // display: grid on the body when the new bar is used. We'll just apply it always here. + document.body.classList.add('rgthree-force-new-comfyui-grid-layout'); if (position === "bottom") { queryOne(".comfyui-body-bottom")!.appendChild(this.progressBarEl); } else { diff --git a/web/comfyui/rgthree.css b/web/comfyui/rgthree.css index fb7c5c1..1afb40d 100644 --- a/web/comfyui/rgthree.css +++ b/web/comfyui/rgthree.css @@ -534,14 +534,19 @@ rgthree-progress-bar { box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.25), 0px 1px 0px rgba(255, 255, 255, 0.125); } -* ~ rgthree-progress-bar { - box-shadow: inset 0px 1px 0px rgb(0, 0, 0), inset 0px 2px 0px rgba(255, 255, 255, 0.15), inset 0px -1px 0px rgba(0, 0, 0, 0.25), 0px 1px 0px rgba(255, 255, 255, 0.125); +* ~ rgthree-progress-bar, +.comfyui-body-bottom rgthree-progress-bar { + box-shadow: 0px -1px 0px rgb(0, 0, 0), inset 0px 1px 0px rgba(255, 255, 255, 0.15), inset 0px -1px 0px rgba(0, 0, 0, 0.25), 0px 1px 0px rgba(255, 255, 255, 0.125); } body > rgthree-progress-bar { position: fixed; } +body.rgthree-force-new-comfyui-grid-layout { + display: grid; +} + .rgthree-debug-keydowns { display: block; position: fixed; diff --git a/web/comfyui/rgthree.js b/web/comfyui/rgthree.js index 45d39bc..80461c6 100644 --- a/web/comfyui/rgthree.js +++ b/web/comfyui/rgthree.js @@ -180,7 +180,7 @@ class Rgthree extends EventTarget { await this.rgthreeCssPromise; if (!this.progressBarEl) { this.progressBarEl = RgthreeProgressBar.create(); - this.progressBarEl.setAttribute("title", "Progress Bar by gthree. (Right-click for rgthree menu)"); + this.progressBarEl.setAttribute("title", "Progress Bar by rgthree. right-click for rgthree menu."); this.progressBarEl.addEventListener("contextmenu", async (e) => { e.stopPropagation(); e.preventDefault(); @@ -215,6 +215,7 @@ class Rgthree extends EventTarget { const isUpdatedComfyBodyClasses = !!queryOne(".comfyui-body-top"); const position = CONFIG_SERVICE.getConfigValue("features.progress_bar.position"); if (isUpdatedComfyBodyClasses) { + document.body.classList.add('rgthree-force-new-comfyui-grid-layout'); if (position === "bottom") { queryOne(".comfyui-body-bottom").appendChild(this.progressBarEl); }