Crates.io | relm4-icons |
lib.rs | relm4-icons |
version | 0.8.3 |
source | src |
created_at | 2023-03-15 21:42:52.618184 |
updated_at | 2024-07-12 10:38:43.753491 |
description | Icons for gtk-rs and Relm4 applications |
homepage | https://relm4.org |
repository | https://github.com/Relm4/icons |
max_upload_size | |
id | 811003 |
size | 6,707,642 |
More than 3000 icons, ready for use in your app!
You can either use the of the over 3000 shipped icons or your own icons. You can browse the shipped icons using one of the following methods:
For icons from the GNOME icon-development-kit:
For icons from Fluent UI System Icons:
For browsing all shipped icons:
Sometimes, icons-development-kit and Fluent UI System Icons have overlapping icon names, so the postfix "-alt" is added.
Create a file called icons.toml
next to the Cargo.toml
file of your app:
# Recommended: Specify your app ID *OR* your base resource path for more robust icon loading
app_id = "com.my.app"
base_resource_path = "/com/my/app/"
# List of icon names you found (shipped with this crate)
# Note: the file ending `-symbolic.svg` isn't part of the icon name.
icons = ["plus", "minus"]
# Optional: Specify a folder containing your own SVG icons
icon_folder = "my_svg_icons"
relm4-icons = "0.8.0"
Add this to your initialization code:
relm4_icons::initialize_icons();
Use set_icon_name
and similar methods to use your icons, for example with
ButtonExt
,
StackPage
,
MenuButton
or
Image
.
let button = gtk::Button::default();
button.set_icon_name("plus");
You can also use the icon_names
module for extra compile-time generated icon names.
use relm4_icons::icon_names;
let button = gtk::Button::default();
button.set_icon_name(icon_names::PLUS);
To add new icons, move them into the icons
folder and make sure their file name ends with -symbolic.svg
.
Then run the following commands:
cd update_icons
cargo run
The source code of Relm4 icons is licensed under the terms of both the MIT license and the Apache License (Version 2.0).
icons/icon-development-kit
folder are licensed under the terms of the CC0 license and therefore public domain.icons/fluentui-system-icons
folder are licensed under the terms of the MIT license.Both licenses should work for both open source and proprietary applications (without warranty).