mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
![]() When referencing an image a repeated element and were targeting a configuration that requires resource embedding, then that image would not embedded. This was due to the fact that we didn't recurse into sub-components in the resource collection phase and the generators made a per-component embedding decision. The field responsible for that was also not propagated to sub-components. This patch addresses these two bugs by cleaning up the entire mechanism: The compiler first generates the new ResourceReference::AbsolutePath for all img!"foo.png" expressions. If the compiler is configured to embed resources, then the embed_resources pass will traverse all sub-components and expressions in them to change them to ResourceReference::EmbeddedData with a unique integer id. Simultaenously all the resources to be embedded get also collected in the root component, so that the build script as well as the generator can take care of dependency handling and actual resource embedding. |
||
---|---|---|
.. | ||
sixtyfps-build | ||
sixtyfps-macros | ||
build.rs | ||
Cargo.toml | ||
compile_fail_tests.rs | ||
docs | ||
docs.rs | ||
lib.rs | ||
README.md | ||
sixtyfps-docs-integration.html |
SixtyFPS-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.0.2"
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.
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