diff options
Diffstat (limited to 'widgets/system.lua')
| -rw-r--r-- | widgets/system.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/widgets/system.lua b/widgets/system.lua index 231192c..1db3c45 100644 --- a/widgets/system.lua +++ b/widgets/system.lua @@ -53,7 +53,7 @@ function M.draw(cr, rect, colors) end -- Height the non-equaliser content needs, in units of S, plus a reserve for -- the equaliser band. The smaller of that budget and the width fit is S. - local fixed_units = 1.30 + 1.13 + temp_n * ROW_F * 1.8 + 0.10 + local fixed_units = 1.00 + 1.13 + temp_n * ROW_F * 1.8 + 0.10 local S = clamp(math.min(inner.h * 0.96 / (fixed_units + 1.7), card.fit_unit(cr, inner.w * 0.96, groups, 100)), 10, 72) local label_size = S * LABEL_F @@ -62,19 +62,20 @@ function M.draw(cr, rect, colors) local y = inner.y - -- Aggregate load, the headline number. + -- Aggregate load, the headline number. It takes the header line, right + -- aligned like the big value on every other card, with the label top-left. + card.font(cr, card.FONT_HEAVY, big_size, false) + card.rgba(cr, load and card.threshold(load, 25, 75, colors) or colors.label) + card.text_right(cr, inner.x + inner.w, y + big_size, load_txt) + card.font(cr, card.FONT_MONO, label_size, false) card.rgba(cr, colors.label) card.text(cr, inner.x, y + label_size, 'CPU') - card.font(cr, card.FONT_HEAVY, big_size, false) - card.rgba(cr, load and card.threshold(load, 25, 75, colors) or colors.label) - card.text(cr, inner.x, y + label_size + big_size, load_txt) - -- The equaliser: one bar per core, rising from a common baseline. It takes -- the room left between the header and the RAM/temperature block, so it is -- the card's slack absorber. - local eq_top = y + label_size + big_size + S * 0.30 + local eq_top = y + big_size + S * 0.30 local bar_h = S * 0.18 local step = row_size * 1.8 local eh = clamp((inner.y + inner.h) - eq_top - (S * 1.13 + temp_n * step), |
