fix: 修正 Windows 标题栏 overlay 计算过小导致的控件重叠并升级到 4.1.7

This commit is contained in:
ILoveBingLu
2026-04-08 20:54:01 +08:00
parent ade1e14402
commit e4cf1893f4
5 changed files with 21 additions and 6 deletions
+9 -2
View File
@@ -98,11 +98,18 @@ export function syncWindowControlsOverlayToDocument(
}
const normalizedPlatform = normalizeWindowPlatform(platform)
const fallbackMetrics = getWindowChromeMetrics(normalizedPlatform)
const overlayPadding = WINDOW_CONTROLS_OVERLAY_PADDING[normalizedPlatform]
const controlsRightWidth = Math.max(0, viewportWidth - titlebarAreaRect.x - titlebarAreaRect.width)
const chromeHeight = Math.max(parsePixels(WINDOW_CHROME_HEIGHT), titlebarAreaRect.height)
const controlsLeftSafe = Math.max(overlayPadding.left, titlebarAreaRect.x + overlayPadding.left)
const controlsRightSafe = Math.max(overlayPadding.right, controlsRightWidth + overlayPadding.right)
const controlsLeftSafe = Math.max(
parsePixels(fallbackMetrics.controlsLeftSafe),
titlebarAreaRect.x + overlayPadding.left
)
const controlsRightSafe = Math.max(
parsePixels(fallbackMetrics.controlsRightSafe),
controlsRightWidth + overlayPadding.right
)
root.style.setProperty('--window-chrome-height', toPixels(chromeHeight))
root.style.setProperty('--window-controls-left-safe', toPixels(controlsLeftSafe))