fix: adjusted tray icon size to match linux platform requirements

This commit is contained in:
kangfenmao 2024-11-11 18:03:03 +08:00
parent b77f845cb0
commit 23ef4ab952

View File

@ -30,12 +30,12 @@ export class TrayService {
tray.setImage(resizedImage)
} else if (process.platform === 'linux') {
const image = nativeImage.createFromPath(iconPath)
const resizedImage = image.resize({ width: 24, height: 24 })
const resizedImage = image.resize({ width: 16, height: 16 })
tray.setImage(resizedImage)
nativeTheme.on('updated', () => {
const newIconPath = nativeTheme.shouldUseDarkColors ? iconLight : iconDark
const newImage = nativeImage.createFromPath(newIconPath)
const newResizedImage = newImage.resize({ width: 24, height: 24 })
const newResizedImage = newImage.resize({ width: 16, height: 16 })
tray.setImage(newResizedImage)
})
}