-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtopbar.html
More file actions
96 lines (88 loc) · 2.15 KB
/
Copy pathtopbar.html
File metadata and controls
96 lines (88 loc) · 2.15 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Top Bar</title>
<style>
body {
margin: 0;
background: #333;
color: white;
display: flex;
justify-content: space-between;
align-items: center;
font-family: sans-serif;
height: 32px;
-webkit-user-select: none;
-webkit-app-region: drag;
}
#controls {
display: flex;
gap: 8px;
margin-right: 10px;
}
button {
-webkit-app-region: no-drag;
padding: 4px 10px;
background: #555;
border: none;
border-radius: 4px;
color: white;
cursor: pointer;
font-weight: bold;
}
button#clear {
background: #ff4d4f;
}
#notification {
position: absolute;
top: 8px;
right: 10px;
background: #4caf50;
color: white;
padding: 6px 12px;
border-radius: 4px;
display: none;
font-size: 12px;
z-index: 1000;
}
</style>
</head>
<body>
<div style="margin-left:12px;">
<h3 style="margin:0; font-size:14px; line-height:32px;">Flight Strip Manager</h3>
</div>
<div id="controls">
<button id="minimize">—</button>
<button id="maximize">⬜</button>
<button id="close">✕</button>
</div>
<script>
const { ipcRenderer } = window.electron;
document.getElementById('minimize').addEventListener('click', async () => {
try {
await ipcRenderer.invoke('window-control', 'minimize');
console.log('Minimize sent');
} catch (err) {
console.error('Minimize failed:', err);
}
});
document.getElementById('maximize').addEventListener('click', async () => {
try {
await ipcRenderer.invoke('window-control', 'maximize');
console.log('Maximize sent');
} catch (err) {
console.error('Maximize failed:', err);
}
});
document.getElementById('close').addEventListener('click', async () => {
try {
await ipcRenderer.invoke('window-control', 'close');
console.log('Close sent');
} catch (err) {
console.error('Close failed:', err);
}
});
</script>
</body>
</html>