mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 02:59:07 +08:00
feat: add zoom factor handling on window restore in WindowService (#6169)
Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
This commit is contained in:
parent
0c32ac1262
commit
db01b4981d
@ -76,6 +76,7 @@ export class WindowService {
|
|||||||
webSecurity: false,
|
webSecurity: false,
|
||||||
webviewTag: true,
|
webviewTag: true,
|
||||||
allowRunningInsecureContent: true,
|
allowRunningInsecureContent: true,
|
||||||
|
zoomFactor: configManager.getZoomFactor(),
|
||||||
backgroundThrottling: false
|
backgroundThrottling: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -185,6 +186,12 @@ export class WindowService {
|
|||||||
mainWindow.webContents.setZoomFactor(configManager.getZoomFactor())
|
mainWindow.webContents.setZoomFactor(configManager.getZoomFactor())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// set the zoom factor again when the window is going to restore
|
||||||
|
// minimize and restore will cause zoom reset
|
||||||
|
mainWindow.on('restore', () => {
|
||||||
|
mainWindow.webContents.setZoomFactor(configManager.getZoomFactor())
|
||||||
|
})
|
||||||
|
|
||||||
// ARCH: as `will-resize` is only for Win & Mac,
|
// ARCH: as `will-resize` is only for Win & Mac,
|
||||||
// linux has the same problem, use `resize` listener instead
|
// linux has the same problem, use `resize` listener instead
|
||||||
// but `resize` will fliker the ui
|
// but `resize` will fliker the ui
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user