mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-19 13:34:34 -04:00
feat(tracker): show CPU load percentage in the song panel
This commit is contained in:
parent
1a13fadd75
commit
340620ed49
@ -129,6 +129,14 @@ func (t *SongPanel) layoutSongOptions(gtx C, tr *Tracker) D {
|
||||
layout.Rigid(func(gtx C) D {
|
||||
return layoutSongOptionRow(gtx, tr.Theme, "Cursor step", NumUpDown(tr.Theme, t.Step, "Cursor step").Layout)
|
||||
}),
|
||||
layout.Rigid(func(gtx C) D {
|
||||
cpuload := tr.Model.CPULoad()
|
||||
label := Label(tr.Theme, &tr.Theme.SongPanel.RowValue, fmt.Sprintf("%.0f %%", cpuload*100))
|
||||
if cpuload >= 1 {
|
||||
label.Color = tr.Theme.SongPanel.ErrorColor
|
||||
}
|
||||
return layoutSongOptionRow(gtx, tr.Theme, "CPU load", label.Layout)
|
||||
}),
|
||||
)
|
||||
})
|
||||
}),
|
||||
|
Reference in New Issue
Block a user