A crate that loads and caches themed icons in 100% safe rust.
Just add it to your cargo.toml
file like this:
[dependencies]
icon-loader = "0.4"
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'.theme_error_log
: Feature that uses the log
crate to log errors that occur while parsing icon themes. IconLoader
object to load icons from the systems hicolor
icon theme:
```rust
use iconloader::iconloader_hicolor;if let Some(icon) = iconloaderhicolor().loadicon("audio-headphones") { let path = icon.filefor_size(64).path(); } ```
let loader = IconLoader::new_kde().unwrap();
if let Some(icon) = loader.loadicon("audio-headphones") { let path = icon.filefor_size(64).path(); } ```
let mut loader = IconLoader::new(); loader.setsearchpaths(&["pathtoyouricontheme"]); loader.setthemenameprovider("nameofyouricontheme"); loader.updatetheme_name();
if let Some(icon) = loader.loadicon("iconname") { let path = icon.fileforsize(32).path(); } ```
This project is licensed under the MIT License - see the LICENSE.md file for details