mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 13:10:30 +08:00
fix traffic font
This commit is contained in:
parent
b46904e32f
commit
7ff61b697f
@ -156,21 +156,21 @@ const mihomoTraffic = async (): Promise<void> => {
|
|||||||
const data = e.data as string
|
const data = e.data as string
|
||||||
const json = JSON.parse(data) as IMihomoTrafficInfo
|
const json = JSON.parse(data) as IMihomoTrafficInfo
|
||||||
if (trafficHopping) {
|
if (trafficHopping) {
|
||||||
tray?.setTitle('↑' + `${calcTraffic(json.up)}/s`.padStart(14), {
|
tray?.setTitle('↑' + `${calcTraffic(json.up)}/s`.padStart(12), {
|
||||||
fontType: 'monospacedDigit'
|
fontType: 'monospaced'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
tray?.setTitle('↓' + `${calcTraffic(json.down)}/s`.padStart(14), {
|
tray?.setTitle('↓' + `${calcTraffic(json.down)}/s`.padStart(12), {
|
||||||
fontType: 'monospacedDigit'
|
fontType: 'monospaced'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
trafficHopping = !trafficHopping
|
trafficHopping = !trafficHopping
|
||||||
|
|
||||||
tray?.setToolTip(
|
tray?.setToolTip(
|
||||||
'↑' +
|
'↑' +
|
||||||
`${calcTraffic(json.up)}/s`.padStart(14) +
|
`${calcTraffic(json.up)}/s`.padStart(12) +
|
||||||
'\n↓' +
|
'\n↓' +
|
||||||
`${calcTraffic(json.down)}/s`.padStart(14)
|
`${calcTraffic(json.down)}/s`.padStart(12)
|
||||||
)
|
)
|
||||||
trafficRetry = 10
|
trafficRetry = 10
|
||||||
mainWindow?.webContents.send('mihomoTraffic', json)
|
mainWindow?.webContents.send('mihomoTraffic', json)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user