Repository navigation
v0.3.3 — Custom Icon Roles
Custom Icon Roles
Apps can now extend the icon system with domain-specific icons via TOML-driven code generation and the IconProvider trait.
Added
IconProvidertrait for defining custom icon types that integrate with native-theme's loading systemload_custom_icon()dispatching custom icons through the same platform loader chain as built-in iconsload_system_icon_by_name()for loading platform icons by arbitrary name stringnative-theme-buildcrate: TOML-driven code generation withgenerate_icons()andIconGeneratorbuilder API, plus 6 build-time validation error types- DE-aware code generation: freedesktop mapping entries can specify per-desktop-environment icon names (e.g.,
{ kde = "view-visible", default = "view-reveal" }) - gpui connector:
custom_icon_to_image_source()andcustom_icon_to_image_source_colored() - iced connector:
custom_icon_to_image_handle(),custom_icon_to_svg_handle(), andcustom_icon_to_svg_handle_colored() - Icon mapping gap fills and coverage regression tests
Changed
IconRolenow implementsIconProvider, delegating to built-in mapping functions- Platform icon loaders return
Nonefor unmapped roles instead of falling back to Material SVGs
Removed
- Wildcard Material SVG fallback from
load_icon()and all platform loaders — each icon set is now self-contained
Quick Start
[dependencies]
native-theme = { version = "0.3.3", features = ["material-icons"] }
[build-dependencies]
native-theme-build = "0.3.3"See the custom icon roles documentation for the full TOML → codegen → load workflow.
Full Changelog: v0.3.2...v0.3.3