aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/now.lua
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/now.lua')
-rw-r--r--widgets/now.lua18
1 files changed, 9 insertions, 9 deletions
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