INNER CODE UNIT · TypeScript

setTray

EutropicAI/Final2x · src/main/index.ts:84

function setTray(): void {
  const Image = nativeImage.createFromPath(trayIcon)
  Image.setTemplateImage(true)
  tray = new Tray(Image)

  const contextMenu = Menu.buildFromTemplate([
    {
      label: 'Open',
      click: (): void => {
        // On macOS it's common to re-create a window in the app when the
        // dock icon is clicked and there are no other windows open.
        if (BrowserWindow.getAllWindows().length === 0) {
          createWindow()
        }
        else {
          BrowserWindow.getAllWindows()[0].show()
        }
      },

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…