[−][src]Crate icon_loader
Crate to load and cache themed icons.
If you enable the sync
feature flag, all provided structs and enums will be Send
and Sync
.
Examples
- Loading icons from the default icon theme set in KDE:
use icon_loader::{IconLoader, ThemeNameProvider}; let mut loader = IconLoader::new(); loader.set_theme_name_provider(ThemeNameProvider::KDE); loader.update_theme_name().unwrap(); let icon = loader.load_icon("audio-headphones").unwrap(); let path = icon.file_for_size(64).path();
- Loading icons from a custom theme in a provided folder:
use icon_loader::IconLoader; let mut loader = IconLoader::new(); loader.set_search_paths(&["path_to_your_icon_theme"]); loader.set_theme_name_provider("name_of_your_icon_theme"); loader.update_theme_name().unwrap(); let icon = loader.load_icon("icon_name").unwrap(); let path = icon.file_for_size(32).path();
Structs
Icon | Struct containing information about a themed icon. |
IconDir | Struct that holds information about a directory containing a set of icons with a particular size. |
IconFile | Struct containing information about a single icon file on disk. |
IconLoader | The central icon loader struct. |
Enums
Error | Error type returned by this crate. |
IconType | Enum representing the different file types an icon can be. |
ProviderError | Error type returned by |
SearchPaths | Enum that provides a list of directories to |
ThemeNameProvider | Enum that provides a theme name to |
Type Definitions
Result | Type alias for |