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.2"
Cargo-Features
kde
: Standard feature that lets you read the default system theme name from '~/.config/kdeglobals'.gtk
: Standard feature that lets you read the default system theme name from '~/.config/gtk-3.0/settings.ini'.
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;
License
This project is licensed under the MIT License - see the LICENSE.md file for details