aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/network.lua
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-18 19:09:23 +0200
committerDanilo M. <danix@danix.xyz>2026-09-18 19:09:23 +0200
commitd975c14645554cfbe9ba1d8c9279f51bd8407673 (patch)
treee5b60d21939ea02b4e2cb50a4342d071763083b1 /widgets/network.lua
parent7fddddcd39bb250cd2653e130c8f7899d2d3f19c (diff)
downloadconky-theme-udt-d975c14645554cfbe9ba1d8c9279f51bd8407673.tar.gz
conky-theme-udt-d975c14645554cfbe9ba1d8c9279f51bd8407673.zip
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.
Diffstat (limited to 'widgets/network.lua')
-rw-r--r--widgets/network.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/widgets/network.lua b/widgets/network.lua
index 5d1a8ca..3a11521 100644
--- a/widgets/network.lua
+++ b/widgets/network.lua
@@ -80,7 +80,8 @@ function M.draw(cr, rect, colors)
-- taken as the smaller of a height budget and a measured width fit.
local LABEL_F, BIG_F, ROW_F = 0.30, 1.0, 0.30
local groups = {
- { { 'NET', card.FONT_MONO, LABEL_F }, { '888.8M/s', card.FONT_HEAVY, BIG_F } },
+ { { card.title_str(card.ICON.network, 'NET'), card.FONT_MONO, LABEL_F },
+ { '888.8M/s', card.FONT_HEAVY, BIG_F } },
{ { '\u{F0318} 192.000.000.000', card.FONT_MONO, ROW_F } },
{ { '\u{F01DA} 888.8M/s', card.FONT_MONO, ROW_F },
{ '\u{F0552} 888.8M/s', card.FONT_MONO, ROW_F } },
@@ -98,8 +99,7 @@ function M.draw(cr, rect, colors)
card.text_right(cr, inner.x + inner.w, inner.y + S * BIG_F, rate_str(down))
card.font(cr, card.FONT_MONO, label_size, false)
- card.rgba(cr, colors.label)
- card.text(cr, inner.x, inner.y + label_size, 'NET')
+ card.title(cr, inner.x, inner.y + label_size, card.ICON.network, 'NET', colors)
local ey = inner.y + S * BIG_F + row_size * 1.4
local step = row_size * 2.2