Rust Icon Loader

A crate that loads and caches themed icons in 100% safe rust.

Usage

Just add it to your cargo.toml file like this: [dependencies] icon-loader = "0.1"

Examples

let mut loader = IconLoader::new(); loader.setthemenameprovider(ThemeNameProvider::KDE); loader.updatetheme_name().unwrap();

let icon = loader.loadicon("audio-headphones").unwrap(); let path = icon.filefor_size(64).path(); ```

let mut loader = IconLoader::new(); loader.setsearchpaths(&["pathtoyouricontheme"]); loader.setthemenameprovider("nameofyouricontheme"); loader.updatetheme_name().unwrap();

let icon = loader.loadicon("iconname").unwrap(); let path = icon.fileforsize(32).path(); ```

Features

Default features are "kde" and "gtk", which enable reading the default system icon theme name from the kde and gtk config files, respectively. Additionally you can activate the "sync" feature, which will make all provided structs and enums in this crate Send and Sync.

License

License