-
-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathrenderer.ts
More file actions
48 lines (43 loc) · 1.42 KB
/
Copy pathrenderer.ts
File metadata and controls
48 lines (43 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* This file will automatically be loaded by webpack and run in the "renderer" context.
* To learn more about the differences between the "main" and the "renderer" context in
* Electron, visit:
*
* https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes
*
* By default, Node.js integration in this file is disabled. When enabling Node.js integration
* in a renderer process, please be aware of potential security implications. You can read
* more about security risks here:
*
* https://electronjs.org/docs/tutorial/security
*
* To enable Node.js integration in this file, open up `main.js` and enable the `nodeIntegration`
* flag:
*
* ```
* // Create the browser window.
* mainWindow = new BrowserWindow({
* width: 800,
* height: 600,
* webPreferences: {
* nodeIntegration: true
* }
* });
* ```
*/
import { ipcRenderer, webFrame } from "electron";
import { renderReactApp } from "./reactApp";
import { GENERAL_ACTIONS } from "./constants/IpcConnection";
import "./styles/index.css";
import "./styles/colors.css";
// Setup general action event listeners
ipcRenderer.on(GENERAL_ACTIONS.ZOOM_IN, () => {
webFrame.setZoomLevel(webFrame.getZoomLevel() + 0.5);
});
ipcRenderer.on(GENERAL_ACTIONS.ZOOM_OUT, () => {
webFrame.setZoomLevel(webFrame.getZoomLevel() - 0.5);
});
ipcRenderer.on(GENERAL_ACTIONS.ZOOM_RESET, () => {
webFrame.setZoomLevel(0);
});
renderReactApp();