diff options
Diffstat (limited to 'widgets/calendar.lua')
| -rw-r--r-- | widgets/calendar.lua | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/widgets/calendar.lua b/widgets/calendar.lua index 6194447..b31e3b2 100644 --- a/widgets/calendar.lua +++ b/widgets/calendar.lua @@ -52,24 +52,6 @@ local function when(e) return string.format('%02d/%02d %s', e.d, e.m, e.start or 'all day') end --- The failure face: the sampler has not run. Named, as the other cached cards --- do, rather than a blank cell that cannot be told from a crashed widget. -local function draw_empty(cr, inner, colors, label_f, note, hint) - 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, { - { { 'CALENDAR', card.FONT_MONO, label_f } }, - { { note, card.FONT_UI, 0.36 } }, - { { hint, card.FONT_MONO, 0.32 } }, - }, 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, 'CALENDAR') - card.font(cr, card.FONT_UI, S * 0.36, true) - card.text(cr, inner.x, inner.y + S + S * label_f * 2.6, note) - card.font(cr, card.FONT_MONO, S * 0.32, false) - card.text(cr, inner.x, inner.y + S + S * label_f * 2.6 + S * 0.72, hint) -end - -- The legend: one coloured dot and name per calendar, along the card's bottom. -- Wraps to a second line when the names do not fit, and drops any that still -- do not: a legend spilling off the card is worse than a short one, since the @@ -103,7 +85,7 @@ function M.draw(cr, rect, colors) local cal = data.calendar_parse(data.slurp(CACHE) or '') if not cal then - draw_empty(cr, inner, colors, LABEL_F, 'no calendar data', + card.notice(cr, inner, colors, 'CALENDAR', 'no calendar data', 'bin/calendar-sample.sh') return end |
