MCPcopy Index your code
hub / github.com/ZToolsCenter/ZTools / createTrayMenu

Method createTrayMenu

src/main/managers/windowManager.ts:578–616  ·  view source on GitHub ↗

* 创建托盘菜单

()

Source from the content-addressed store, hash-verified

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 * 获取主窗口实例

Callers 1

createTrayMethod · 0.95

Calls 2

toggleWindowMethod · 0.95
showSettingsMethod · 0.95

Tested by

no test coverage detected