Update tray icon for macos

This commit is contained in:
TheThomaas 2024-12-23 12:49:35 +01:00
parent 96eb5541e9
commit e3088133f3

View file

@ -104,6 +104,12 @@ app.whenReady().then(() => {
tray.setIgnoreDoubleClickEvents(true) tray.setIgnoreDoubleClickEvents(true)
const contextMenu = Menu.buildFromTemplate([ const contextMenu = Menu.buildFromTemplate([
...(process.platform === 'darwin' ? [{
label: 'Show',
click: _ => {
mainWindow.show()
}
}] : []),
{ {
label: 'Hide', label: 'Hide',
click: _ => { click: _ => {
@ -118,14 +124,16 @@ app.whenReady().then(() => {
} }
}, },
]) ])
tray.setToolTip('Umbra') tray.setToolTip(app.getName())
tray.setContextMenu(contextMenu) tray.setContextMenu(contextMenu)
// Prevent menu from being shown on left click // Prevent menu from being shown on left click
// Instead make main window visible (if it had been invisible) // Instead make main window visible (if it had been invisible)
if (process.platform !== 'darwin') {
tray.on('click', _ => { tray.on('click', _ => {
mainWindow.show() mainWindow.show()
}) })
}
ipcMain.handle('game:insert', async (_, game: Game) => { ipcMain.handle('game:insert', async (_, game: Game) => {