Counteract zoom-level changes in custom titlebar

This commit is contained in:
Fedor Indutny 2022-06-20 11:26:31 -07:00 committed by GitHub
parent dacbee711f
commit 9407654262
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 123 additions and 34 deletions

View file

@ -700,7 +700,16 @@ export async function startApp(): Promise<void> {
},
});
webFrame.setZoomFactor(window.Events.getZoomFactor());
const zoomFactor = window.Events.getZoomFactor();
webFrame.setZoomFactor(zoomFactor);
document.body.style.setProperty('--zoom-factor', zoomFactor.toString());
window.addEventListener('resize', () => {
document.body.style.setProperty(
'--zoom-factor',
webFrame.getZoomFactor().toString()
);
});
// How long since we were last running?
const lastHeartbeat = toDayMillis(window.storage.get('lastHeartbeat', 0));