File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,21 @@ async function initializeWindow(): Promise<BrowserWindow> {
268
268
mainWindow . webContents . setVisualZoomLevelLimits ( 1 , 1 )
269
269
} )
270
270
271
+ function applyZoom ( ) {
272
+ const zoomFactor = processZoomForScreen (
273
+ configStore . get ( 'zoomPercent' , 100 ) / 100
274
+ )
275
+ mainWindow . webContents . setZoomLevel ( zoomFactor )
276
+ mainWindow . webContents . setVisualZoomLevelLimits ( 1 , 1 )
277
+ }
278
+
279
+ mainWindow . on ( 'maximize' , applyZoom )
280
+ mainWindow . on ( 'unmaximize' , applyZoom )
281
+ mainWindow . on ( 'restore' , applyZoom )
282
+ mainWindow . on ( 'enter-full-screen' , applyZoom )
283
+ mainWindow . on ( 'leave-full-screen' , applyZoom )
284
+ mainWindow . webContents . on ( 'did-navigate' , applyZoom )
285
+
271
286
return mainWindow
272
287
}
273
288
You can’t perform that action at this time.
0 commit comments