From 3553b0af9d4f07e83ba4eb4e7ba19dc5486604b4 Mon Sep 17 00:00:00 2001 From: Bradley Cicenas Date: Sun, 12 Mar 2017 22:00:17 +0000 Subject: [PATCH] cap cpu gauge % to 100 in compact view --- cwidgets/compact/setters.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cwidgets/compact/setters.go b/cwidgets/compact/setters.go index e23a383..638db34 100644 --- a/cwidgets/compact/setters.go +++ b/cwidgets/compact/setters.go @@ -30,6 +30,9 @@ func (row *Compact) SetCPU(val int) { val = 5 row.Cpu.BarColor = ui.ThemeAttr("gauge.bar.bg") } + if val > 100 { + val = 100 + } row.Cpu.Percent = val }