Skip to content

v0.3.3 — Custom Icon Roles

Choose a tag to compare

@tiborgats tiborgats released this 17 Mar 12:05
· 1733 commits to main since this release

Custom Icon Roles

Apps can now extend the icon system with domain-specific icons via TOML-driven code generation and the IconProvider trait.

Added

  • IconProvider trait for defining custom icon types that integrate with native-theme's loading system
  • load_custom_icon() dispatching custom icons through the same platform loader chain as built-in icons
  • load_system_icon_by_name() for loading platform icons by arbitrary name string
  • native-theme-build crate: TOML-driven code generation with generate_icons() and IconGenerator builder 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() and custom_icon_to_image_source_colored()
  • iced connector: custom_icon_to_image_handle(), custom_icon_to_svg_handle(), and custom_icon_to_svg_handle_colored()
  • Icon mapping gap fills and coverage regression tests

Changed

  • IconRole now implements IconProvider, delegating to built-in mapping functions
  • Platform icon loaders return None for 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