Explorar el Código

支持系统托盘被左键双击的时候能够显示主窗口

SUPCON\guotao hace 2 años
padre
commit
46cc8af99f
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      electron/addon/tray/index.js

+ 3 - 0
electron/addon/tray/index.js

@@ -62,6 +62,9 @@ class TrayAddon {
     this.tray.setToolTip(cfg.title);
     const contextMenu = Menu.buildFromTemplate(trayMenuTemplate);
     this.tray.setContextMenu(contextMenu);
+    this.tray.on('double-click', () => {
+      mainWindow.show()
+    })
   }
 }