Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Tweak the tutorial #7967

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

docs: Tweak the tutorial #7967

wants to merge 2 commits into from

Conversation

NigelBreslaw
Copy link
Member

The wording was quite confusing before. To talk about declaring items 'below' to then draw in 'above'. So the thinking here is that 'before' and 'after' is just for talking about the text in the file. Then 'above' and 'below' is just used when talking about how items are drawn? Maybe even remove the text and just show the slint snipet?

@NigelBreslaw NigelBreslaw requested a review from tronical March 27, 2025 11:50
In this step, you add a curtain-like cover that opens when clicked. Slint files have an implicit z order for drawing items.
Each subsequent item is drawn above the previous one. So a `Rectangle` on line 10 would be underneath another declared later
in the file on line 50. To give the impression of curtains that cover the image,
declare two rectangles after the <span class="hljs-built_in">Image</span>, so that Slint draws them over the Image.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍

@@ -48,7 +48,7 @@ in a <LangRefLink lang="nodejs" relpath="classes/ArrayModel">`slint.ArrayModel.h
The code uses the `rand` dependency for the randomization. Add it to the `Cargo.toml` file using the `cargo` command.

```sh
cargo add rand@0.8
cargo add rand
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue I see with removing the version is that when a new, source-incompatible version of Rand is released, the tutorial needs fixing (and we have to find out first). Is there a specific reason for removing the version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, its an older version now. Let me update and see if the code is still valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants