relm4-icons-build

Crates.iorelm4-icons-build
lib.rsrelm4-icons-build
version
sourcesrc
created_at2024-10-30 15:35:41.147358
updated_at2024-12-04 12:02:40.51393
descriptionIcons for gtk-rs and Relm4 applications
homepagehttps://relm4.org
repositoryhttps://github.com/Relm4/icons
max_upload_size
id1428699
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | 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`
size0
Aaron Erhardt (AaronErhardt)

documentation

README

relm4-icons-build

This crate provides the build-time functionality to bundle icons into the binary. It is used in the build.rs file of the project that uses relm4-icons.

Usage

Add this to your Cargo.toml:

[build-dependencies]
relm4-icons-build = { version = "0.8.0" }

And in your build.rs file, use relm4-icons-build to bundle the icons and include them in the compiled binary:

fn main() {
    relm4_icons_build::bundle_icons(
        // Name of the file that will be generated at `OUT_DIR`
        "icon_names.rs",
        // Optional app ID
        Some("com.example.myapp"),
        // Custom base resource path:
        // * defaults to `/com/example/myapp` in this case if not specified explicitly
        // * or `/org/relm4` if app ID was not specified either
        None::<&str>,
        // Directory with custom icons (if any)
        None::<&str>,
        // List of icons to include
        [
            "ssd",
            "size-horizontally",
            "cross",
        ],
    );
}

And in your main.rs or lib.rs file, create a module named icon_names:

mod icon_names {
    include!(concat!(env!("OUT_DIR"), "/icon_names.rs"));
}
Commit count: 93

cargo fmt