Relm4 icons - Icons for your gtk-rs and Relm4 applications!
More than 3000 icons, ready for use in your app!
Installing librsvg
The relm4-icons crate relies on librsvg for rendering SVG icons. Ensure that librsvg is installed on your system before using this crate. The installation process varies depending on your operating system.
# Linux (Debian/Ubuntu)
# Macos
# Windows
Usage
1. Find your icons 🔍
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:
- Install Icon library
- Browse the GNOME icon resource
For icons from Fluent UI System Icons:
- Browse the fluent icon library catalog
For browsing all shipped icons:
Sometimes, icons-development-kit and Fluent UI System Icons have overlapping icon names, so the postfix "-alt" is added.
2. Add Relm4 icons ✍
= "0.10"
[]
= "0.10"
3. Add the icons to your project 📦
Add the following to your build.rs:
4. Load the icons 🛫
Add this to your initialization code:
5. Use the icons 🎉
Use set_icon_name and similar methods to use your icons, for example with
ButtonExt,
StackPage,
MenuButton or
Image.
Example
let button = default;
button.set_icon_name;
You can also use the icon_names module for extra compile-time generated icon names.
use crateicon_names;
let button = default;
button.set_icon_name;
How it works
Crate
- Collect all icons specified in the config file
- Build a gresource bundle containing only the selected icons
- Include the gresource file in the compiled binary
- On initialization load the gresource file
Add new icons
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:
Existing icon sets can be updated as submodules with following commands:
Credit
- GNOME contributors for providing so many outstanding icons
- gvdb-rs for providing a great crate for interacting with gresources in pure Rust
- gtk-rs for outstanding Rust bindings for GTK4
Legal
The source code of Relm4 icons is licensed under the terms of both the MIT license and the Apache License (Version 2.0).
Icons
- The icons in the
icons/icon-development-kitfolder are licensed under the terms of the CC0 license and therefore public domain. - The icons in the
icons/fluentui-system-iconsfolder are licensed under the terms of the MIT license.
Both licenses should work for both open source and proprietary applications (without warranty).