From d975c14645554cfbe9ba1d8c9279f51bd8407673 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 18 Sep 2026 19:09:23 +0200 Subject: feat: add a title icon to every labelled card Add card.ICON and a card.title helper that draws the glyph in the highlight colour before the label, at the label's own size. The eight labelled cards use it, in both the fit_unit width measurement and the draw, so the icon cannot overrun a narrow cell. Clock (no label) and weather (condition glyph already) are unchanged, and the no-data notice titles stay text-only. Codepoints were chosen against a rendered contact sheet, not fontconfig alone, since a wrong codepoint draws a plausible neighbour. --- widgets/breaktimer.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'widgets/breaktimer.lua') diff --git a/widgets/breaktimer.lua b/widgets/breaktimer.lua index e6487b8..6fed30e 100644 --- a/widgets/breaktimer.lua +++ b/widgets/breaktimer.lua @@ -43,7 +43,7 @@ function M.draw(cr, rect, colors) -- Fluid type: the height budget grows the content to fill the cell, the -- measured width fit pulls it back where the phase label would overrun. local groups = { - { { 'BREAKTIMER', card.FONT_MONO, LABEL_F }, + { { card.title_str(card.ICON.breaktimer, 'BREAKTIMER'), card.FONT_MONO, LABEL_F }, { bt.countdown, card.FONT_HEAVY, BIG_F } }, } for _, r in ipairs(rows) do @@ -60,8 +60,8 @@ function M.draw(cr, rect, colors) card.text_right(cr, inner.x + inner.w, inner.y + S * BIG_F, bt.countdown) card.font(cr, card.FONT_MONO, label_size, false) - card.rgba(cr, colors.label) - card.text(cr, inner.x, inner.y + label_size, 'BREAKTIMER') + card.title(cr, inner.x, inner.y + label_size, card.ICON.breaktimer, + 'BREAKTIMER', colors) local ey = inner.y + S * BIG_F + row_size * 1.6 local step = row_size * 2.0 -- cgit v1.2.3