mirror of
https://github.com/ILoveBingLu/CipherTalk.git
synced 2026-05-23 13:01:41 +08:00
fix: 修正 Windows 标题栏 overlay 计算过小导致的控件重叠并升级到 4.1.7
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user