feat(icons): render widget icons as built-in vector art#32
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BuiltinIconset rendered as normalized vector paths viatiny-skia— no SVG parser, icon font, or icon-rendering dependency ships in the bar.icons/*.svgat build time by the newtools/icongendev tool (never linked into tablero) into a committed data module (builtin_icon_paths.rs).iconfield: 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 keepformat-iconstext overrides via the{icon}placeholder. The idle module shows an open padlock while active and a closed padlock while inhibited.Follow-up polish
warn/chargingstates and unknown profiles are unchanged.CPU/MEMwords. Opting icons out restores the spelled-outCPU x% MEM y%. The shared renderer gained multi-icon templates to draw a distinct icon per slot.format-iconsglyph map is removed so the colored vector icons show through.Test plan
Closes NUKE-65