From e64b2ee13088d51cd0f8b60ba59bbacec198d5fa Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 4 Jul 2023 01:46:25 +0900 Subject: [PATCH] fix: resolve #18 --- src/Application.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Application.ts b/src/Application.ts index 6320342b..b1ceb912 100644 --- a/src/Application.ts +++ b/src/Application.ts @@ -1,6 +1,6 @@ import cors from '@koa/cors'; import alsong from 'alsong'; -import { app, BrowserWindow, Menu, dialog, screen, shell, Tray, ipcMain } from 'electron'; +import { app, BrowserWindow, Menu, dialog, screen, shell, Tray, ipcMain, nativeImage } from 'electron'; import { autoUpdater } from 'electron-updater'; import glasstron from 'glasstron'; import Koa from 'koa'; @@ -65,7 +65,12 @@ class Application { } initTray() { - this.tray = new Tray(getFile('./assets/icon_music.png')); + const trayIcon = nativeImage.createFromPath(getFile('./assets/icon_square.png')); + trayIcon.resize({ + width: 16, + height: 16, + }); + this.tray = new Tray(trayIcon); const contextMenu = Menu.buildFromTemplate([ { type: 'normal',