diff options
| -rw-r--r-- | widgets/system.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/widgets/system.lua b/widgets/system.lua index 03cd70a..d4f6188 100644 --- a/widgets/system.lua +++ b/widgets/system.lua @@ -102,16 +102,23 @@ function M.draw(cr, rect, colors) -- The hardware this card is about, under the header. Truncated by character, -- never by byte: a model string can carry a multi-byte character and half of -- one draws as a replacement box. + -- Two accents rather than one label colour: the rows name two different + -- pieces of hardware, and giving each its own hue separates them at a glance + -- without a prefix like 'CPU:' eating the width. `heading` and `highlight` + -- are the two roles that carry no state meaning, so they can stand for an + -- identity; ok/warning/critical could not, since those say how something is + -- doing and these strings never change. local id_y = y + big_size + row_size * 0.2 if cpu_txt or board_txt then card.font(cr, card.FONT_MONO, row_size, false) - card.rgba(cr, colors.label) local id_limit = math.max(8, math.floor(inner.w / (row_size * 0.55))) if cpu_txt then + card.rgba(cr, colors.heading) card.text(cr, inner.x, id_y, card.truncate(cpu_txt, id_limit)) id_y = id_y + row_size * 1.5 end if board_txt then + card.rgba(cr, colors.highlight) card.text(cr, inner.x, id_y, card.truncate(board_txt, id_limit)) id_y = id_y + row_size * 1.5 end |
