From 9001b61dd3d48b7dedff40810cf258cbc3b41fee Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 18 Oct 2026 15:06:26 +0200 Subject: feat(now): the condition as a large glyph instead of words The leftover height under the rows now holds the condition glyph, large, as the card's variable band. weather.describe() and its table had no other caller and go with the text. Co-Authored-By: Claude Opus 5.5 --- widgets/now.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'widgets') diff --git a/widgets/now.lua b/widgets/now.lua index 6273ed1..f00c46e 100644 --- a/widgets/now.lua +++ b/widgets/now.lua @@ -31,15 +31,15 @@ function M.draw(cr, rect, colors) big = weather.deg(c.temp), rows = rows, share = 0.85, }) - -- The condition in words, in the prose face, in what the rows left. It sits - -- on the card's foot: the type is capped to match the other cards, so a tall - -- cell leaves height over, and that gap belongs above the line, not below. - local size = S * 0.36 - local foot = inner.y + inner.h - size * 0.25 - if y + size * 1.4 <= foot then - card.font(cr, card.FONT_UI, size, false) - card.rgba(cr, colors.body) - card.text(cr, inner.x, foot, weather.describe(c.code)) + -- The condition as a large glyph, the card's variable band: the type is + -- capped to match the other cards, so a tall cell leaves height over, and the + -- glyph takes it. Dropped when there is no room for one bigger than a row. + local size = math.min(inner.y + inner.h - y, inner.w * 0.45) + if size > S * 0.6 then + card.font(cr, card.FONT_MONO, size, false) + card.rgba(cr, colors.highlight) + card.text_centre(cr, inner.x + inner.w / 2, inner.y + inner.h - size * 0.15, + weather.icon(c.code, c.is_day)) end end -- cgit v1.2.3