@@ -47,6 +47,10 @@ export class EventsManager {
47
47
this . initIPC ( )
48
48
}
49
49
50
+ async checkNativeTheme ( ) {
51
+ await this . switchTheme ( nativeTheme . shouldUseDarkColors ? THEME . DARK : THEME . LIGHT )
52
+ }
53
+
50
54
private initIPC ( ) {
51
55
powerMonitor . on ( 'suspend' , ( ) => this . managePowerSuspension ( true ) )
52
56
powerMonitor . on ( 'resume' , ( ) => this . managePowerSuspension ( false ) )
@@ -94,6 +98,9 @@ export class EventsManager {
94
98
ipcMain . handle ( REMOTE_RENDERER . SYNC . TRANSFER_LOGS , async ( ev : IpcMainInvokeEventServer , action : string , syncPathId : number , query : string ) =>
95
99
this . onSyncTransferLogs ( ev , action , syncPathId , query )
96
100
)
101
+ appEvents . on ( LOCAL_RENDERER . WINDOW . ZOOM . IN , ( ) => this . windowZoomIn ( ) )
102
+ appEvents . on ( LOCAL_RENDERER . WINDOW . ZOOM . OUT , ( ) => this . windowZoomOut ( ) )
103
+ appEvents . on ( LOCAL_RENDERER . WINDOW . ZOOM . RESET , ( ) => this . windowZoomReset ( ) )
97
104
appEvents . on ( LOCAL_RENDERER . UPDATE . DOWNLOADED , ( msg : string ) => this . viewsManager . sendToWrapperRenderer ( LOCAL_RENDERER . UPDATE . DOWNLOADED , msg ) )
98
105
appEvents . on ( LOCAL_RENDERER . POWER . PREVENT_APP_SUSPENSION , ( state : boolean ) => this . manageAppPreventSuspension ( state ) )
99
106
}
@@ -116,10 +123,6 @@ export class EventsManager {
116
123
}
117
124
}
118
125
119
- async checkNativeTheme ( ) {
120
- await this . switchTheme ( nativeTheme . shouldUseDarkColors ? THEME . DARK : THEME . LIGHT )
121
- }
122
-
123
126
private serverAuthentication ( ev : any ) : SyncClientAuth {
124
127
const server = ServersManager . find ( ev . sender . serverId )
125
128
return { clientId : server . authID , token : server . authToken , info : genClientInfos ( ) }
@@ -323,4 +326,21 @@ export class EventsManager {
323
326
}
324
327
appEvents . emit ( LOCAL_RENDERER . POWER . SUSPENSION_EVENT , state )
325
328
}
329
+
330
+ private windowZoomIn ( ) {
331
+ if ( ! this . viewsManager . currentView ) return
332
+ const zFactor = this . viewsManager . currentView . webContents . getZoomFactor ( )
333
+ this . viewsManager . currentView . webContents . setZoomFactor ( zFactor + 0.1 )
334
+ }
335
+
336
+ private windowZoomOut ( ) {
337
+ if ( ! this . viewsManager . currentView ) return
338
+ const zFactor = this . viewsManager . currentView . webContents . getZoomFactor ( )
339
+ this . viewsManager . currentView . webContents . setZoomFactor ( zFactor - 0.1 )
340
+ }
341
+
342
+ private windowZoomReset ( ) {
343
+ if ( ! this . viewsManager . currentView ) return
344
+ this . viewsManager . currentView . webContents . setZoomFactor ( 1 )
345
+ }
326
346
}
0 commit comments