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
- Loading icons from the default icon theme set in KDE:
use ;
let mut loader = new;
loader.set_theme_name_provider;
loader.update_theme_name.unwrap;
let icon = loader.load_icon.unwrap;
let path = icon.file_for_size.path;
- Loading icons from a custom theme in a provided folder:
use IconLoader;
let mut loader = new;
loader.set_search_paths;
loader.set_theme_name_provider;
loader.update_theme_name.unwrap;
let icon = loader.load_icon.unwrap;
let path = icon.file_for_size.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
.