[codex] Guard traffic light sync off macOS (#531)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
const isMac = navigator.userAgent.includes('Mac')
|
||||
|
||||
/**
|
||||
* Apply a UI zoom level change: sets webFrame zoom via the preload API,
|
||||
* updates the CSS variable used to compensate the traffic-light pad,
|
||||
@@ -7,7 +9,9 @@ export function applyUIZoom(level: number): void {
|
||||
const zoomFactor = Math.pow(1.2, level)
|
||||
window.api.ui.setZoomLevel(level)
|
||||
document.documentElement.style.setProperty('--ui-zoom-factor', String(zoomFactor))
|
||||
window.api.ui.syncTrafficLights(zoomFactor)
|
||||
if (isMac) {
|
||||
window.api.ui.syncTrafficLights(zoomFactor)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -18,5 +22,7 @@ export function syncZoomCSSVar(): void {
|
||||
const level = window.api.ui.getZoomLevel()
|
||||
const zoomFactor = Math.pow(1.2, level)
|
||||
document.documentElement.style.setProperty('--ui-zoom-factor', String(zoomFactor))
|
||||
window.api.ui.syncTrafficLights(zoomFactor)
|
||||
if (isMac) {
|
||||
window.api.ui.syncTrafficLights(zoomFactor)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user