aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/hourly.lua
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-18 15:03:20 +0200
committerDanilo M. <danix@danix.xyz>2026-10-18 15:03:20 +0200
commit24f0a89b0bbe28899a8e8be6e6ac7ec676fec1b8 (patch)
treec6a805dcd4fb61656fac06a506e73cd9d8aa6045 /widgets/hourly.lua
parent6bab42ac36c1e08d336bc38cb815530ba10729cf (diff)
downloadconky-theme-udt-24f0a89b0bbe28899a8e8be6e6ac7ec676fec1b8.tar.gz
conky-theme-udt-24f0a89b0bbe28899a8e8be6e6ac7ec676fec1b8.zip
feat(hourly): raindrop labels the rain-chance row
The bars had no legend. A raindrop in the bars' own colour sits in a left gutter on their row; the band shifts right by the gutter so the hour columns stay aligned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'widgets/hourly.lua')
-rw-r--r--widgets/hourly.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/widgets/hourly.lua b/widgets/hourly.lua
index dfcc64d..31a425b 100644
--- a/widgets/hourly.lua
+++ b/widgets/hourly.lua
@@ -15,6 +15,12 @@ local function draw_curve(cr, x, y, w, h, colors, hours, S)
local n = math.min(#hours, 24)
local label = math.max(9, math.min(h * 0.135, w / 8 * 0.22, S * 0.32))
local glyph = label * 1.5
+ -- A gutter on the left for the raindrop that labels the rain-chance row.
+ -- The whole band shifts, so the hour columns stay aligned with each other.
+ card.font(cr, card.FONT_MONO, label, false)
+ local gutter = card.advance(cr, weather.ICON.raindrop .. ' ')
+ local x0 = x
+ x, w = x + gutter, w - gutter
local slot = w / n
local function px(i) return x + (i - 0.5) * slot end
local top = y + glyph + label * 1.6
@@ -44,6 +50,7 @@ local function draw_curve(cr, x, y, w, h, colors, hours, S)
end
end
cairo_fill(cr)
+ card.text(cr, x0, base - label * 0.1, weather.ICON.raindrop)
card.rgba(cr, colors.rule, 0.6)
cairo_set_line_width(cr, 1)