freedesktop-icons

Crates.iofreedesktop-icons
lib.rsfreedesktop-icons
version0.2.6
sourcesrc
created_at2022-05-13 09:30:41.473644
updated_at2024-02-13 12:02:42.191035
descriptionA Freedesktop Icons lookup crate
homepage
repositoryhttps://github.com/oknozor/freedestkop-icons
max_upload_size
id585733
size38,769
Paul Delafosse (oknozor)

documentation

README

freedesktop-icons

crates.io-badge docrs-badge

This crate provides a freedesktop icon lookup implementation.

It exposes a single lookup function to find icons based on their name, theme, size and scale.

Example

Simple lookup:

The following snippet get an icon from the default 'hicolor' theme with the default scale (1) and the default size (24).

use freedesktop_icons::lookup;

let icon = lookup("firefox").find();

Complex lookup:

If you have specific requirements for your lookup you can use the provided builder functions:

use freedesktop_icons::lookup;

let icon = lookup("firefox")
    .with_size(48)
    .with_scale(2)
    .with_theme("Arc")
    .find();

Cache:

If your application is going to repeat the same icon lookups multiple times you can use the internal cache to improve performance.

use freedesktop_icons::lookup;

let icon = lookup("firefox")
    .with_size(48)
    .with_scale(2)
    .with_theme("Arc")
    .with_cache()
    .find();
Commit count: 33

cargo fmt