Align CPU values in CPU widget

This commit is contained in:
Aofei Sheng 2020-07-21 18:49:51 +08:00
parent e59e91847b
commit 4a766282cf

View File

@ -120,7 +120,7 @@ func (cpu *CPUWidget) update() {
defer cpu.updateLock.Unlock()
for key, percent := range cpus {
cpu.Data[key] = append(cpu.Data[key], float64(percent))
cpu.Labels[key] = fmt.Sprintf("%d%%", percent)
cpu.Labels[key] = fmt.Sprintf("%3d%%", percent)
cpu.cpuLoads[key] = float64(percent)
}
}()