(rectById: ReadonlyMap<string, Rect>)
| 106 | } |
| 107 | |
| 108 | function buildLayoutDebugOverlay(rectById: ReadonlyMap<string, Rect>): VNode | null { |
| 109 | if (rectById.size === 0) return null; |
| 110 | const rows = [...rectById.entries()] |
| 111 | .sort((a, b) => a[0].localeCompare(b[0])) |
| 112 | .slice(0, 18) |
| 113 | .map(([id, rect]) => |
| 114 | ui.text(`${id} ${String(rect.x)},${String(rect.y)} ${String(rect.w)}x${String(rect.h)}`), |
| 115 | ); |
| 116 | const panel = ui.box({ border: "single", title: `Layout (${String(rectById.size)})`, p: 1 }, [ |
| 117 | ui.column({ gap: 0 }, rows), |
| 118 | ]); |
| 119 | return ui.layer({ |
| 120 | id: "rezi.layout.debug.overlay", |
| 121 | zIndex: 2_000_000_000, |
| 122 | modal: false, |
| 123 | backdrop: "none", |
| 124 | closeOnEscape: false, |
| 125 | content: ui.column({ width: "full", height: "full", justify: "end", p: 1 }, [ |
| 126 | ui.row({ width: "full", justify: "start" }, [panel]), |
| 127 | ]), |
| 128 | }); |
| 129 | } |
| 130 | |
| 131 | function blendThemeColors(from: Theme, to: Theme, t: number): Theme { |
| 132 | return blendTheme(from, to, t); |
no test coverage detected