Add context menu #16

Merged
ishan-karmakar merged 5 commits from add-context-menu into main 2026-06-01 22:56:04 +00:00
Showing only changes of commit c4e57776ca - Show all commits
+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);
}