feat: Add Quit item to context menu

This commit is contained in:
2026-06-01 14:07:08 -05:00
parent 6a8c38145b
commit c4e57776ca
+5 -1
View File
@@ -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);
}