Expand description
Icon loading.
- The semantic roles,
IconRole, and the icon data,IconDataandAnimatedIcon. - A typed loader per icon set (
IconSet):MaterialLoaderandLucideLoaderfor the bundled sets,FreedesktopLoader(Linux),SfSymbolsLoader(macOS) andSegoeFluentLoader(Windows) for the platform sets. Each needs its set’s feature,material-icons,lucide-iconsorsystem-icons, and givesNonewithout it. load_iconandload_icon_indicator, which load from whichever set they are given.- The icon-set choice of a settings UI,
IconSetChoice.
Structs§
- Empty
Frame List Error - Error returned when attempting to create a
FrameListfrom an empty vec. - Frame
List - A non-empty list of icon frames for animation.
- Frames
Data - Data for a frame-based animation. Fields are private; use accessor methods.
- Freedesktop
Loader - Loader for freedesktop.org icon themes (GTK / Linux).
- Lucide
Loader - Loader for Lucide Icons (bundled SVG).
- Material
Loader - Loader for Google Material Symbols (bundled SVG).
- Rgba
Data - Rasterized RGBA pixels whose buffer holds exactly
width × height × 4bytes. - Segoe
Fluent Loader - Loader for Windows Segoe Fluent Icons (Windows only).
- SfSymbols
Loader - Loader for Apple SF Symbols (macOS only).
- Transform
Data - Data for a transform-based animation. Fields are private; use accessor methods.
Enums§
- Animated
Icon - An animated icon, either frame-based or transform-based.
- Icon
Data - Icon data returned by loading functions.
- IconId
- Identifies what icon to load: a semantic role, a platform-specific name, or a custom provider.
- Icon
Role - Semantic icon roles for cross-platform icon resolution.
- Icon
SetChoice - The user’s icon set selection mode.
- Transform
Animation - A CSS-like transform animation applied to a single icon.
Constants§
- MAX_
ICON_ SIZE - The largest size, in pixels (points for an SF Symbol), that the system
loaders (
FreedesktopLoader::size,SfSymbolsLoader::size,SegoeFluentLoader::size), and through themload_custom_iconandload_custom_icon_in, andrasterize::rasterize_svg(featuresvg-rasterize) load or draw an icon at: a larger size is taken as this one, and 0 as 1.
Traits§
- Icon
Provider - Trait for types that map icon identifiers to platform-specific names and SVG data.
Functions§
- colorize_
monochrome_ svg - Colour a monochrome SVG icon in its bytes.
- default_
icon_ choice - Determine the default icon set choice for a theme.
- fill_
current_ color - Fill a symbolic icon’s
currentColorin withcolor, in its bytes. - icon_
name - Look up the platform-specific icon identifier for a given icon set and role.
- is_
freedesktop_ theme_ available - Check whether a freedesktop icon theme is installed on this system.
- list_
freedesktop_ themes - List installed freedesktop icon themes.
- load_
custom_ icon - Load a custom icon from an
IconProviderfor a set known only at runtime, incolor, atsize. - load_
custom_ icon_ in load_custom_icon, with a freedesktop icon looked up inicon_theme(FreedesktopLoader::theme) where it isSome, the system’s icon theme where it isNone.sizeis clamped to1..=MAX_ICON_SIZEas there.- load_
icon - Load an icon using the given set with default per-set options.
- load_
icon_ indicator - Load the animated loading indicator for the given set.