添加黑色托盘图标
This commit is contained in:
@@ -7,12 +7,17 @@ let themeId = null
|
||||
const themeList = [
|
||||
{
|
||||
id: 0,
|
||||
fileName: 'tray0Template',
|
||||
fileName: 'trayTemplate',
|
||||
isNative: true,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
fileName: 'tray1Template',
|
||||
fileName: 'tray_origin',
|
||||
isNative: false,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
fileName: 'tray_black',
|
||||
isNative: false,
|
||||
},
|
||||
]
|
||||
@@ -43,8 +48,8 @@ const createTray = () => {
|
||||
if ((global.modules.tray && !global.modules.tray.isDestroyed()) || !global.appSetting.tray || !global.appSetting.tray.isShow) return
|
||||
|
||||
themeId = global.appSetting.tray.themeId
|
||||
let themeName = (themeList.find(item => item.id === themeId) || themeList[0]).fileName
|
||||
const iconPath = path.join(global.__static, 'images/tray', themeName + '.png')
|
||||
let theme = themeList.find(item => item.id === themeId) || themeList[0]
|
||||
const iconPath = path.join(global.__static, 'images/tray', theme.fileName + '.png')
|
||||
|
||||
// 托盘
|
||||
global.modules.tray = new Tray(nativeImage.createFromPath(iconPath))
|
||||
@@ -140,7 +145,7 @@ 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', themeName + '.png')
|
||||
let theme = themeList.find(item => item.id === themeId) || themeList[0]
|
||||
const iconPath = path.join(global.__static, 'images/tray', theme.fileName + '.png')
|
||||
global.modules.tray.setImage(nativeImage.createFromPath(iconPath))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user