mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 02:05:22 -04:00
Merge branch 'pr-594' into visual-pr-playground
This commit is contained in:
@@ -938,9 +938,24 @@ function _rerenderCachedModels() {
|
|||||||
document.body.appendChild(popup);
|
document.body.appendChild(popup);
|
||||||
panel._gpuProbe.popup = popup;
|
panel._gpuProbe.popup = popup;
|
||||||
|
|
||||||
|
// Position below the button using viewport coords (popup is
|
||||||
|
// position:fixed). Measure the popup AFTER it's in the DOM so
|
||||||
|
// we get the real rendered size, then clamp both axes so the
|
||||||
|
// popup stays fully visible — GPU buttons near the right edge
|
||||||
|
// of the modal previously anchored the popup mostly off-screen.
|
||||||
const r = anchorBtn.getBoundingClientRect();
|
const r = anchorBtn.getBoundingClientRect();
|
||||||
popup.style.left = `${Math.max(8, r.left)}px`;
|
const vw = window.innerWidth || document.documentElement.clientWidth;
|
||||||
popup.style.top = `${r.bottom + 4 + window.scrollY}px`;
|
const vh = window.innerHeight || document.documentElement.clientHeight;
|
||||||
|
const pw = popup.offsetWidth || 320;
|
||||||
|
const ph = popup.offsetHeight || 200;
|
||||||
|
let left = r.left;
|
||||||
|
let top = r.bottom + 4;
|
||||||
|
// Push left so the popup doesn't overflow the right edge.
|
||||||
|
if (left + pw > vw - 8) left = Math.max(8, vw - pw - 8);
|
||||||
|
// If there isn't room below, render above the button instead.
|
||||||
|
if (top + ph > vh - 8) top = Math.max(8, r.top - ph - 4);
|
||||||
|
popup.style.left = `${left}px`;
|
||||||
|
popup.style.top = `${top}px`;
|
||||||
|
|
||||||
popup.querySelector('.cookbook-gpu-popup-close')?.addEventListener('click', _closeProbePopup);
|
popup.querySelector('.cookbook-gpu-popup-close')?.addEventListener('click', _closeProbePopup);
|
||||||
popup.querySelectorAll('.cookbook-gpu-kill').forEach(btn => {
|
popup.querySelectorAll('.cookbook-gpu-kill').forEach(btn => {
|
||||||
|
|||||||
+6
-2
@@ -17874,8 +17874,12 @@ body.gallery-selecting .gallery-dl-btn,
|
|||||||
.cookbook-gpu-clear:disabled { opacity: 0.4; cursor: wait; }
|
.cookbook-gpu-clear:disabled { opacity: 0.4; cursor: wait; }
|
||||||
/* GPU probe popup — per-GPU process list with kill buttons */
|
/* GPU probe popup — per-GPU process list with kill buttons */
|
||||||
.cookbook-gpu-popup {
|
.cookbook-gpu-popup {
|
||||||
position: absolute;
|
/* Fixed positioning (relative to viewport) so we never get pulled into
|
||||||
z-index: 240;
|
a scrolling/transform stacking context from an ancestor. Z-index has
|
||||||
|
to clear the cookbook modal (260) and the rest of the high-z UI
|
||||||
|
layers (themed-confirm and various overlays sit around 9000-10000). */
|
||||||
|
position: fixed;
|
||||||
|
z-index: 10010;
|
||||||
min-width: 280px;
|
min-width: 280px;
|
||||||
max-width: 420px;
|
max-width: 420px;
|
||||||
background: var(--panel, #1a1a1a);
|
background: var(--panel, #1a1a1a);
|
||||||
|
|||||||
Reference in New Issue
Block a user