Crates.io | freedesktop-icons |
lib.rs | freedesktop-icons |
version | |
source | src |
created_at | 2022-05-13 09:30:41.473644+00 |
updated_at | 2025-02-08 19:29:29.276477+00 |
description | A Freedesktop Icons lookup crate |
homepage | |
repository | https://github.com/oknozor/freedestkop-icons |
max_upload_size | |
id | 585733 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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
.
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();