Skip to content

Commit 7ff61b6

Browse files
author
pompurin404
committedAug 15, 2024··
fix traffic font
1 parent b46904e commit 7ff61b6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎src/main/core/mihomoApi.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -156,21 +156,21 @@ const mihomoTraffic = async (): Promise<void> => {
156156
const data = e.data as string
157157
const json = JSON.parse(data) as IMihomoTrafficInfo
158158
if (trafficHopping) {
159-
tray?.setTitle('↑' + `${calcTraffic(json.up)}/s`.padStart(14), {
160-
fontType: 'monospacedDigit'
159+
tray?.setTitle('↑' + `${calcTraffic(json.up)}/s`.padStart(12), {
160+
fontType: 'monospaced'
161161
})
162162
} else {
163-
tray?.setTitle('↓' + `${calcTraffic(json.down)}/s`.padStart(14), {
164-
fontType: 'monospacedDigit'
163+
tray?.setTitle('↓' + `${calcTraffic(json.down)}/s`.padStart(12), {
164+
fontType: 'monospaced'
165165
})
166166
}
167167
trafficHopping = !trafficHopping
168168

169169
tray?.setToolTip(
170170
'↑' +
171-
`${calcTraffic(json.up)}/s`.padStart(14) +
171+
`${calcTraffic(json.up)}/s`.padStart(12) +
172172
'\n↓' +
173-
`${calcTraffic(json.down)}/s`.padStart(14)
173+
`${calcTraffic(json.down)}/s`.padStart(12)
174174
)
175175
trafficRetry = 10
176176
mainWindow?.webContents.send('mihomoTraffic', json)

0 commit comments

Comments
 (0)
Please sign in to comment.