Skip to content

feat(icons): render widget icons as built-in vector art#32

Merged
piny4man merged 3 commits into
mainfrom
feat/nuke-65-built-in-vector-icons
Jul 24, 2026
Merged

feat(icons): render widget icons as built-in vector art#32
piny4man merged 3 commits into
mainfrom
feat/nuke-65-built-in-vector-icons

Conversation

@piny4man

@piny4man piny4man commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace Nerd Font private-use glyphs across every status widget with a semantic BuiltinIcon set rendered as normalized vector paths via tiny-skia — no SVG parser, icon font, or icon-rendering dependency ships in the bar.
  • Icons are flattened from icons/*.svg at build time by the new tools/icongen dev tool (never linked into tablero) into a committed data module (builtin_icon_paths.rs).
  • Every icon-bearing widget gains an icon field: omitted → built-in art, icon = "none" → opt out (label-only), icon = "<text>" → literal glyph override. Volume follows the level (low/medium/high/muted); power-profiles/backlight keep format-icons text overrides via the {icon} placeholder. The idle module shows an open padlock while active and a closed padlock while inhibited.
  • README and the example config no longer present a Nerd Font as required.

Follow-up polish

  • State-based colors (no extra config): battery foreground ramps orange→yellow→green by charge tier and turns green while charging; power-profiles icons take a per-profile accent — green power-saver, blue balanced, yellow performance. Configured warn/charging states and unknown profiles are unchanged.
  • Memory icon: the system widget now pairs a cpu icon and a memory icon, each with its own percent, instead of the CPU/MEM words. Opting icons out restores the spelled-out CPU x% MEM y%. The shared renderer gained multi-icon templates to draw a distinct icon per slot.
  • Sharper tray: prefer the themed hi-res tray icon over a small embedded pixmap (larger source by pixel area wins, themed on a tie) so tray art no longer looks upscaled/blocky next to hosts like Waybar.
  • Example config: the tray drops its background/border so app icons sit transparent on the bar, and the power-profiles format-icons glyph map is removed so the colored vector icons show through.

Test plan

  • cargo build --all-targets
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • cargo test --all

Closes NUKE-65

piny4man added 3 commits July 24, 2026 12:28
Replace the Nerd Font private-use glyphs in every status widget with a
semantic BuiltinIcon set rendered as normalized vector paths through
tiny-skia. Icons inherit each widget's state colors and scale with the
output, and the shipped bar gains no SVG parser, icon font, or other
icon-rendering dependency: the paths are flattened from icons/*.svg at
build time by the new tools/icongen dev tool (never linked into tablero)
into a committed data module.

Every icon-bearing widget now takes an `icon` field: omitted uses the
built-in art, `icon = "none"` opts out for a simpler label-only look, and
`icon = "<text>"` overrides with a literal glyph. Volume follows the
level (low/medium/high/muted) rather than the device kind, and
power-profiles/backlight keep their `format-icons` text overrides via the
`{icon}` placeholder. The idle module shows an open padlock while active
and a closed padlock while inhibited.

README and the example config no longer present a Nerd Font as required.

Closes NUKE-65
Give the built-in vector icons semantic color with no extra config:
battery foreground ramps orange→yellow→green by charge tier and turns
green while charging, and power-profiles icons take a per-profile accent
(green power-saver, blue balanced, yellow performance). Unknown profiles
and the configured warn/charging states are unchanged.

The system widget now pairs a cpu icon and a memory icon each with its
own percent instead of the "CPU"/"MEM" words; opting icons out restores
the spelled-out "CPU x% MEM y%" text. The shared renderer gains
multi-icon templates to draw a distinct icon per slot.

Prefer the themed hi-res tray icon over a small embedded pixmap so tray
art renders sharp instead of upscaled-blocky, matching hosts like
Waybar; the larger source by pixel area wins, themed on a tie.

The example config drops the tray background/border so app icons sit
transparent on the bar, and drops the power-profiles format-icons glyph
map so the colored vector icons show through.

Closes NUKE-65
`cargo doc` runs with `-D warnings` in CI, where an intra-doc link from a
public item to a private one is a hard error. The module and `BuiltinIcon`
docs linked the private `builtin_icon_paths` module and `BuiltinIcon::stem`
method; demote both to plain inline code so the docs build clean.
@piny4man
piny4man merged commit 1a2313e into main Jul 24, 2026
1 check passed
@piny4man
piny4man deleted the feat/nuke-65-built-in-vector-icons branch July 24, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant