aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/cache.lua
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-18 18:41:31 +0200
committerDanilo M. <danix@danix.xyz>2026-09-18 18:41:31 +0200
commit7fddddcd39bb250cd2653e130c8f7899d2d3f19c (patch)
treeca427df07676563853fb7f25f6ce4eb14e63a25b /widgets/cache.lua
parent37cabe2fea2f86d481516aae6ddaeb14bac2e64f (diff)
downloadconky-theme-udt-7fddddcd39bb250cd2653e130c8f7899d2d3f19c.tar.gz
conky-theme-udt-7fddddcd39bb250cd2653e130c8f7899d2d3f19c.zip
refactor: unify card no-data face and fluid sizing
Extract card.notice so every cached card's no-data state is one fluid, theme-consistent face instead of a copy per widget, and delete the fixed-size card.label it replaces. Derive weather's arc geometry from its band (pad, curve room, sun dot, time labels) instead of fixed pixels, and cap the arc at a proportion of the card's width rather than 240px. Derive disks' bar-fallback height and its address type from the card's own label scale. Standardise the big-value factor to 1.0 across the fit_unit cards and document the big-value colour rule and the disks headline exception.
Diffstat (limited to 'widgets/cache.lua')
-rw-r--r--widgets/cache.lua15
1 files changed, 1 insertions, 14 deletions
diff --git a/widgets/cache.lua b/widgets/cache.lua
index af20347..3772458 100644
--- a/widgets/cache.lua
+++ b/widgets/cache.lua
@@ -22,20 +22,7 @@ function M.draw(cr, rect, colors)
local c = data.du_parse(data.slurp(CACHE) or '')
if not c then
- local S = clamp(inner.h * 0.94 / (1.78 + 2 * 0.72), 10, 72)
- S = math.min(S, card.fit_unit(cr, inner.w * 0.96, {
- { { 'CACHE', card.FONT_MONO, LABEL_F } },
- { { 'no cache data', card.FONT_UI, 0.36 } },
- { { 'bin/cache-sample.sh', card.FONT_MONO, ROW_F } },
- }, 100))
- card.font(cr, card.FONT_MONO, S * LABEL_F, false)
- card.rgba(cr, colors.label)
- card.text(cr, inner.x, inner.y + S * LABEL_F, 'CACHE')
- card.font(cr, card.FONT_UI, S * 0.36, true)
- card.text(cr, inner.x, inner.y + S + S * LABEL_F * 2.6, 'no cache data')
- card.font(cr, card.FONT_MONO, S * ROW_F, false)
- card.text(cr, inner.x, inner.y + S + S * LABEL_F * 2.6 + S * 0.72,
- 'bin/cache-sample.sh')
+ card.notice(cr, inner, colors, 'CACHE', 'no cache data', 'bin/cache-sample.sh')
return
end