-
Notifications
You must be signed in to change notification settings - Fork 0
/
electron-tweaks.cjs
56 lines (48 loc) · 1.09 KB
/
electron-tweaks.cjs
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
53
54
55
56
const { ipcRenderer } = require("electron");
const macOS = process.platform == "darwin";
function tweaks() {
// CSS
let style = document.createElement("style");
style.innerHTML = `
/*
.topbar > button {
display: none;
}
*/
.topbar {
display: none;
}
`;
if (macOS) {
// Account for inset toolbar
style.innerHTML += `
.topbar > h4 {
margin-left: 64px;
}
`;
}
document.querySelector("head").appendChild(style);
}
ipcRenderer.on("update-vcd", (ev, vcd)=> {
let { name, value } = vcd;
window.setTitle(name);
window.vcd = value;
window.load();
});
ipcRenderer.on("zoom", (ev, action)=> {
if (!window.wd) {
return;
}
switch (action) {
case "in":
window.wd.zoomIn();
break;
case "out":
window.wd.zoomOut();
break;
case "reset":
window.wd.resetZoom();
break;
}
});
window.addEventListener('DOMContentLoaded', tweaks);