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.4"
Cargo-Features
Standard Features
kde
: Feature that lets you read the default system theme name from '~/.config/kdeglobals'.gtk
: Feature that lets you read the default system theme name from '~/.config/gtk-3.0/settings.ini'.
Additional Features
theme_error_log
: Feature that uses thelog
crate to log errors that occur while parsing icon themes.
Examples
- Using a global
IconLoader
object to load icons from the systemshicolor
icon theme:
use icon_loader_hicolor;
if let Some = icon_loader_hicolor.load_icon
- Loading icons from the default icon theme set in KDE:
use IconLoader;
let loader = new_kde.unwrap;
if let Some = loader.load_icon
- 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;
if let Some = loader.load_icon
License
This project is licensed under the MIT License - see the LICENSE.md file for details