-
-
Notifications
You must be signed in to change notification settings - Fork 748
Expand file tree
/
Copy pathnativeTheme.ts
More file actions
52 lines (40 loc) · 1.39 KB
/
nativeTheme.ts
File metadata and controls
52 lines (40 loc) · 1.39 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
49
50
51
52
import type { Socket } from "net";
import { nativeTheme } from "electron";
let electronSocket: Socket;
export = (socket: Socket) => {
electronSocket = socket;
socket.on("nativeTheme-shouldUseDarkColors", () => {
const shouldUseDarkColors = nativeTheme.shouldUseDarkColors;
electronSocket.emit(
"nativeTheme-shouldUseDarkColors-completed",
shouldUseDarkColors,
);
});
socket.on("nativeTheme-shouldUseHighContrastColors", () => {
const shouldUseHighContrastColors = nativeTheme.shouldUseHighContrastColors;
electronSocket.emit(
"nativeTheme-shouldUseHighContrastColors-completed",
shouldUseHighContrastColors,
);
});
socket.on("nativeTheme-shouldUseInvertedColorScheme", () => {
const shouldUseInvertedColorScheme =
nativeTheme.shouldUseInvertedColorScheme;
electronSocket.emit(
"nativeTheme-shouldUseInvertedColorScheme-completed",
shouldUseInvertedColorScheme,
);
});
socket.on("nativeTheme-getThemeSource", () => {
const themeSource = nativeTheme.themeSource;
electronSocket.emit("nativeTheme-getThemeSource-completed", themeSource);
});
socket.on("nativeTheme-themeSource", (themeSource) => {
nativeTheme.themeSource = themeSource;
});
socket.on("register-nativeTheme-updated", (id) => {
nativeTheme.on("updated", () => {
electronSocket.emit("nativeTheme-updated" + id);
});
});
};