slint/api/sixtyfps-rs
Olivier Goffart 8b9be10ff8 Attempt to properly detect if the native style is available when cross compiling
... and using the sixtyfps! macro

The problem is that the OUT_DIR in the build script of the macro crate
is reporting a target directory for the host (since the macro itself is
built for the host), but we need to get the OUT_DIR of the crate, so query
it in the macro. Unfortunatelty, that env variable is only set when the
crate (using the macro) has a build script. So use a fallback to find the
target directory

Fixes #462
2021-12-06 12:59:48 +01:00
..
sixtyfps-build Bump version number to 0.1.6 2021-11-24 14:19:09 +00:00
sixtyfps-macros Attempt to properly detect if the native style is available when cross compiling 2021-12-06 12:59:48 +01:00
tests Fix the tests 2021-07-29 18:25:23 +02:00
Cargo.toml Don't use Lazy to initialize the ITEM_TREE, use OnceBox instead 2021-12-01 10:36:29 +01:00
compile_fail_tests.rs Update license date 2021-07-02 15:55:54 +02:00
docs Remove trailing slash from docs symlink 2020-09-07 11:22:55 +02:00
docs.rs Adjustment to the rust documentation with regards to global singetons 2021-08-27 18:00:44 +02:00
lib.rs Start working on makeing the generated code no_std 2021-12-01 10:36:29 +01:00
README.md Update version number in docs in preparation for the release 2021-11-24 14:10:16 +01:00

SixtyFPS-rs

Crates.io Docs.rs

A Rust UI toolkit

SixtyFPS is a UI toolkit that supports different programming languages. SixtyFPS-rs is the Rust API to interact with a SixtyFPS UI design from Rust.

The complete Rust documentation can be viewed online at https://sixtyfps.io/docs/rust/sixtyfps/.

Getting Started

The crate documentation shows how to use this crate.

Hello World

The most basic "Hello world" application can be achieved with a few lines of code:

In your Cargo.toml add:

[dependencies]
sixtyfps = "0.1.5"

And in your main.rs:

sixtyfps::sixtyfps!{
    HelloWorld := Window {
        Text {
            text: "hello world";
            color: green;
        }
    }
}
fn main() {
    HelloWorld::new().run();
}

The sixtyfps crate documentation contains more advanced examples and alternative ways to use this crate.

To quickly get started, you can use the Template Repository with the code of a minimal application using SixtyFPS that can be used as a starting point to your program.

cargo install cargo-generate
cargo generate --git https://github.com/sixtyfpsui/sixtyfps-rust-template

More examples

You can quickly try out the examples by cloning this repo and running them with cargo run

# Runs the "printerdemo" example
cargo run --release --bin printerdemo

Minimum Supported Rust Version

This crate's minimum supported rustc version is 1.54.0.