Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Rust GTK App Framework
(Yes that's the icon)
This libaray aims to provide a framework for adaptive GTK4 and libadwaita apps written in Rust.
Writing flatpak apps requires several files (.desktop file, appdata.xml, flatpak manifest). gtk-rust-app and its CLI gra allow to generate these files based on an extended Cargo.toml.
Getting started
Creating apps with gtk-rust-app requires to
- Add more metadata to the Cargo.toml
- Write some boilerplate code in main.rs
- Define App pages
- Optional: Define a build.rs script
- Install cargo-gra subcommand
Cargo.toml
Define app metadata and the dependency to gtk-rust-app in your Cargo.toml (see Manifest for more information):
# Cargo.toml
[]
...
[]
# Metadata of your app
[]
# global settings
[]
# global GTK actions
[]
# as usual
= { = "https://gitlab.com/loers/gtk-rust-app.git", = [ "ui" ] }
# If you want to automatically update generated files you can add this build dependency
[]
= { = "https://gitlab.com/loers/gtk-rust-app.git", = [ "build" ] }
App boilerplate code
Create the file main.rs:
// src/main.rs
extern crate gtk_rust_app;
extern crate log;
use gettext;
use *;
use LeafletLayout;
use crateHome;
// This module will contain our home page
Define app pages
The home page:
//src/home.rs
use ObjectSubclassIsExt;
use *;
use gettext;
use crateCard;
// Define a page of your app as a new widget
// home.ui
True
True
vertical
Optional: Build script
Define the build script:
// build.rs
Install cargo-gra
cargo install cargo-gra
Prepare the app build via:
cargo gra setup
and build it as usual:
cargo build --release
You can build a flatpak app via:
cargo gra flatpak
That's it. You will see an app like this:

The app has adaptive behaviour per default.

Run with different language
LANGUAGE="de_DE:de" LANG="de_DE.utf8" TEXT_DOMAIN="target"
Build
# build your binary release
# create a flatpak
Requirements
Debian dependencies:
sudo apt install libgraphene-1.0-dev libgtk-4-dev flatpak-builder
Arch dependencies:
pacman
To build a flatpak you need the to install gnome-nightly remote. Download https://nightly.gnome.org/gnome-nightly.flatpakrepo.