* 创建托盘菜单
()
| 576 | * 创建托盘菜单 |
| 577 | */ |
| 578 | private createTrayMenu(): void { |
| 579 | if (!this.tray) return |
| 580 | |
| 581 | this.trayMenu = Menu.buildFromTemplate([ |
| 582 | { |
| 583 | label: '显示/隐藏', |
| 584 | click: () => { |
| 585 | this.toggleWindow() |
| 586 | } |
| 587 | }, |
| 588 | { |
| 589 | type: 'separator' |
| 590 | }, |
| 591 | { |
| 592 | label: '设置', |
| 593 | click: () => { |
| 594 | this.showSettings() |
| 595 | } |
| 596 | }, |
| 597 | { |
| 598 | type: 'separator' |
| 599 | }, |
| 600 | { |
| 601 | label: '重启', |
| 602 | click: () => { |
| 603 | this.isQuitting = true |
| 604 | app.relaunch() |
| 605 | app.quit() |
| 606 | } |
| 607 | }, |
| 608 | { |
| 609 | label: '退出', |
| 610 | click: () => { |
| 611 | this.isQuitting = true |
| 612 | app.quit() |
| 613 | } |
| 614 | } |
| 615 | ]) |
| 616 | } |
| 617 | |
| 618 | /** |
| 619 | * 获取主窗口实例 |
no test coverage detected