Make Rust default

This commit is contained in:
Chris Chinchilla 2024-06-05 17:03:55 +02:00 committed by Simon Hausmann
parent e9deb00332
commit 0a76954aa9
5 changed files with 8 additions and 0 deletions

View file

@ -44,6 +44,7 @@ in a [`slint.ArrayModel`](https://slint.dev/docs/node/classes/arraymodel.html) w
::::{tab-item} Rust
:sync: rust
:selected: true
The code uses the `rand` dependency for the randomization. Add it to the `Cargo.toml` file using the `cargo` command.

View file

@ -36,6 +36,7 @@ First, add the tile data structure definition at the top of the `ui/appwindow.sl
:::{tab-item} Rust
:sync: rust
:selected: true
First, add the tile data structure definition at the top of the `slint!` macro:
@ -65,6 +66,7 @@ Next, replace the _export component <span class="hljs-title">MainWindow</span> i
:::{tab-item} Rust
:sync: rust
:selected: true
Next, replace the _export component <span class="hljs-title">MainWindow</span> inherits Window { ... }_ section at the bottom of the `slint!` macro with the following:

View file

@ -90,6 +90,7 @@ Insert this code before the `mainWindow.run()` call:
::::{tab-item} Rust
:sync: rust
:selected: true
Add the following code inside the <span class="hljs-title">MainWindow</span> component to signal to the Rust code when the user clicks on a tile.

View file

@ -130,6 +130,7 @@ Run the example with `npm start` and a window appears with the green "Hello Worl
::::{tab-item} Rust
:sync: rust
:selected: true
We recommend using [rust-analyzer](https://rust-analyzer.github.io) and [our editor integrations for Slint](https://github.com/slint-ui/slint/tree/master/editors) for following this tutorial.

View file

@ -30,6 +30,7 @@ Copy the following code into `ui/appwindow.slint` file, replacing the current co
:::{tab-item} Rust
:sync: rust
:selected: true
Copy the following code inside of the `slint!` macro, replacing the current content:
@ -63,6 +64,7 @@ loads an icon with the <span class="hljs-built_in">@image-url()</span> macro. Th
:::{tab-item} Rust
:sync: rust
:selected: true
Inside the <span class="hljs-built_in">Rectangle</span> place an <span class="hljs-built_in">Image</span> element that
loads an icon with the <span class="hljs-built_in">@image-url()</span> macro.
@ -113,6 +115,7 @@ Running the program with `npm start` opens a window that shows the icon of a bus
:::{tab-item} Rust
:sync: rust
:selected: true
Running the program with `cargo run` opens a window that shows the icon of a bus on a blue background.