添加黑色托盘图标

pull/733/head
lyswhut 2021-10-27 17:11:35 +08:00
parent ea62033cf3
commit cdbcae21ac
18 changed files with 19 additions and 6 deletions

View File

@ -1,6 +1,7 @@
### 新增 ### 新增
- 自定义源新增`version`字段,新增`utils.buffer.bufToString`方法 - 自定义源新增`version`字段,新增`utils.buffer.bufToString`方法
- 添加黑色托盘图标
### 优化 ### 优化

View File

@ -7,12 +7,17 @@ let themeId = null
const themeList = [ const themeList = [
{ {
id: 0, id: 0,
fileName: 'tray0Template', fileName: 'trayTemplate',
isNative: true, isNative: true,
}, },
{ {
id: 1, id: 1,
fileName: 'tray1Template', fileName: 'tray_origin',
isNative: false,
},
{
id: 2,
fileName: 'tray_black',
isNative: false, isNative: false,
}, },
] ]
@ -43,8 +48,8 @@ const createTray = () => {
if ((global.modules.tray && !global.modules.tray.isDestroyed()) || !global.appSetting.tray || !global.appSetting.tray.isShow) return if ((global.modules.tray && !global.modules.tray.isDestroyed()) || !global.appSetting.tray || !global.appSetting.tray.isShow) return
themeId = global.appSetting.tray.themeId themeId = global.appSetting.tray.themeId
let themeName = (themeList.find(item => item.id === themeId) || themeList[0]).fileName let theme = themeList.find(item => item.id === themeId) || themeList[0]
const iconPath = path.join(global.__static, 'images/tray', themeName + '.png') const iconPath = path.join(global.__static, 'images/tray', theme.fileName + '.png')
// 托盘 // 托盘
global.modules.tray = new Tray(nativeImage.createFromPath(iconPath)) global.modules.tray = new Tray(nativeImage.createFromPath(iconPath))
@ -140,7 +145,7 @@ const createMenu = tray => {
const setTrayImage = themeId => { const setTrayImage = themeId => {
if (!global.modules.tray) return if (!global.modules.tray) return
let themeName = (themeList.find(item => item.id === themeId) || themeList[0]).fileName let theme = themeList.find(item => item.id === themeId) || themeList[0]
const iconPath = path.join(global.__static, 'images/tray', themeName + '.png') const iconPath = path.join(global.__static, 'images/tray', theme.fileName + '.png')
global.modules.tray.setImage(nativeImage.createFromPath(iconPath)) global.modules.tray.setImage(nativeImage.createFromPath(iconPath))
} }

View File

@ -120,6 +120,7 @@
"other_resource_cache_clear_btn": "Clear resource cache", "other_resource_cache_clear_btn": "Clear resource cache",
"other_resource_cache_label": "The software has used cache size: ", "other_resource_cache_label": "The software has used cache size: ",
"other_tray_theme": "Tray Icon Style", "other_tray_theme": "Tray Icon Style",
"other_tray_theme_black": "Black Color",
"other_tray_theme_native": "Solid Color", "other_tray_theme_native": "Solid Color",
"other_tray_theme_origin": "Primary Color", "other_tray_theme_origin": "Primary Color",
"play": "Play", "play": "Play",

View File

@ -120,6 +120,7 @@
"other_resource_cache_clear_btn": "清理资源缓存", "other_resource_cache_clear_btn": "清理资源缓存",
"other_resource_cache_label": "软件已使用缓存大小:", "other_resource_cache_label": "软件已使用缓存大小:",
"other_tray_theme": "托盘图标样式", "other_tray_theme": "托盘图标样式",
"other_tray_theme_black": "黑色",
"other_tray_theme_native": "纯色", "other_tray_theme_native": "纯色",
"other_tray_theme_origin": "原色", "other_tray_theme_origin": "原色",
"play": "播放设置", "play": "播放设置",

View File

@ -120,6 +120,7 @@
"other_resource_cache_clear_btn": "清理資源緩存", "other_resource_cache_clear_btn": "清理資源緩存",
"other_resource_cache_label": "軟件已使用緩存大小:", "other_resource_cache_label": "軟件已使用緩存大小:",
"other_tray_theme": "托盤圖標樣式", "other_tray_theme": "托盤圖標樣式",
"other_tray_theme_black": "黑色",
"other_tray_theme_native": "純色", "other_tray_theme_native": "純色",
"other_tray_theme_origin": "原色", "other_tray_theme_origin": "原色",
"play": "播放設置", "play": "播放設置",

View File

@ -455,6 +455,10 @@ export default {
id: 1, id: 1,
name: 'origin', name: 'origin',
}, },
{
id: 2,
name: 'black',
},
] ]
}, },
syncEnableTitle() { syncEnableTitle() {

View File

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 335 B

View File

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 416 B

View File

Before

Width:  |  Height:  |  Size: 483 B

After

Width:  |  Height:  |  Size: 483 B

View File

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 417 B

After

Width:  |  Height:  |  Size: 417 B

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 770 B

After

Width:  |  Height:  |  Size: 770 B