调整图标尺寸

This commit is contained in:
lyswhut
2021-10-27 14:21:32 +08:00
parent 34825b5063
commit b7fb3cd208
17 changed files with 9 additions and 8 deletions
+6 -6
View File
@@ -1,5 +1,5 @@
const { app, Tray, Menu } = require('electron')
const { isWin } = require('../../common/utils')
const { app, Tray, Menu, nativeImage } = require('electron')
// const { isWin } = require('../../common/utils')
const { tray: TRAY_EVENT_NAME, common: COMMON_EVENT_NAME, mainWindow: MAIN_WINDOW_NAME } = require('../events/_name')
const path = require('path')
let isEnableTray = null
@@ -44,10 +44,10 @@ const createTray = () => {
themeId = global.appSetting.tray.themeId
let themeName = (themeList.find(item => item.id === themeId) || themeList[0]).fileName
const iconPath = path.join(global.__static, 'images/tray', isWin ? themeName + '@2x.ico' : themeName + '.png')
const iconPath = path.join(global.__static, 'images/tray', themeName + '.png')
// 托盘
global.modules.tray = new Tray(iconPath)
global.modules.tray = new Tray(nativeImage.createFromPath(iconPath))
global.modules.tray.setToolTip('洛雪音乐助手')
createMenu(global.modules.tray)
@@ -141,6 +141,6 @@ const createMenu = tray => {
const setTrayImage = themeId => {
if (!global.modules.tray) return
let themeName = (themeList.find(item => item.id === themeId) || themeList[0]).fileName
const iconPath = path.join(global.__static, 'images/tray', isWin ? themeName + '@2x.ico' : themeName + '.png')
global.modules.tray.setImage(iconPath)
const iconPath = path.join(global.__static, 'images/tray', themeName + '.png')
global.modules.tray.setImage(nativeImage.createFromPath(iconPath))
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 681 B

After

Width:  |  Height:  |  Size: 622 B