From c4e57776ca39687e197dc030318afcb3e18f87be Mon Sep 17 00:00:00 2001 From: Ishan Karmakar Date: Mon, 1 Jun 2026 14:07:08 -0500 Subject: [PATCH] feat: Add Quit item to context menu --- src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index c270a22..e4ee6ac 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { app, BrowserWindow, ipcMain, nativeImage, shell, Tray } from 'electron'; +import { app, BrowserWindow, ipcMain, Menu, nativeImage, shell, Tray } from 'electron'; import path from 'node:path'; import started from 'electron-squirrel-startup'; import { APP_NAME, DEFAULT_STATUS, GATEWAY_HOST, MANAGEMENT_URL, POLL_INTERVAL_MS, WINDOW_HEIGHT, WINDOW_WIDTH } from './config'; @@ -187,6 +187,10 @@ function showWindow() { function createTray() { const icon = nativeImage.createFromPath(resourcePath('VynteIcon.png')).resize({ width: 18, height: 18 }); tray = new Tray(icon); + const contextMenu = Menu.buildFromTemplate([ + { role: 'quit' } + ]); + tray.setContextMenu(contextMenu); tray.setToolTip(APP_NAME); tray.on('click', showWindow); }