aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/now.lua
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-18 15:06:26 +0200
committerDanilo M. <danix@danix.xyz>2026-10-18 15:06:26 +0200
commit9001b61dd3d48b7dedff40810cf258cbc3b41fee (patch)
treea230422e5e635e9a6ad7e5ff9ad3bcbd67d28463 /widgets/now.lua
parent4be7664c5fcc9c081dca5fb40ec4b9e0a2cc7bd3 (diff)
downloadconky-theme-udt-9001b61dd3d48b7dedff40810cf258cbc3b41fee.tar.gz
conky-theme-udt-9001b61dd3d48b7dedff40810cf258cbc3b41fee.zip
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 <noreply@anthropic.com>
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