No description
Find a file
2024-01-24 17:00:20 +01:00
benches fix: unreverse size and scale builder functions 2022-05-17 07:11:19 +02:00
src chore: remove nightly rustfmt configs 2024-01-24 16:55:48 +01:00
.gitignore chore: update dependencies and add Cargo.lock 2024-01-24 17:00:20 +01:00
Cargo.lock chore: update dependencies and add Cargo.lock 2024-01-24 17:00:20 +01:00
Cargo.toml chore: update dependencies and add Cargo.lock 2024-01-24 17:00:20 +01:00
LICENSE chore: add LICENSE 2022-05-13 11:18:22 +02:00
README.md docs: add crates.io and docs.rs badges 2022-05-17 07:16:01 +02:00

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();