🐛 window系统托盘修复
This commit is contained in:
parent
aaf6cd7255
commit
26c2ab6ff3
@ -84,9 +84,9 @@ async function createWindow() {
|
|||||||
const {Menu} = require("electron");
|
const {Menu} = require("electron");
|
||||||
Menu.setApplicationMenu(null);
|
Menu.setApplicationMenu(null);
|
||||||
// hide menu for Mac
|
// hide menu for Mac
|
||||||
if (process.platform !== "darwin") {
|
// if (process.platform !== "darwin") {
|
||||||
app.dock.hide();
|
// app.dock.hide();
|
||||||
}
|
// }
|
||||||
|
|
||||||
win.on('minimize', function (event) {
|
win.on('minimize', function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -128,6 +128,11 @@ export const createTray = () => {
|
|||||||
tray.setToolTip('Frpc Desktop')
|
tray.setToolTip('Frpc Desktop')
|
||||||
const contextMenu = Menu.buildFromTemplate(menu)
|
const contextMenu = Menu.buildFromTemplate(menu)
|
||||||
tray.setContextMenu(contextMenu)
|
tray.setContextMenu(contextMenu)
|
||||||
|
|
||||||
|
// 托盘双击打开
|
||||||
|
tray.on('double-click', () => {
|
||||||
|
win.show();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user