mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-18 14:27:19 +00:00
Docs: Fix unclear text in reactivity example (#9217)
This commit is contained in:
parent
1479c3f579
commit
007cfd26b9
1 changed files with 26 additions and 27 deletions
|
@ -22,23 +22,21 @@ export component MyComponent {
|
||||||
myRect := Rectangle {
|
myRect := Rectangle {
|
||||||
x: ta.mouse-x;
|
x: ta.mouse-x;
|
||||||
y: ta.mouse-y;
|
y: ta.mouse-y;
|
||||||
width: 40px;
|
width: 60px;
|
||||||
height: 40px;
|
height: 60px;
|
||||||
background: ta.pressed ? orange : white;
|
background: ta.pressed ? orange : skyblue;
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
x: 5px; y: 5px;
|
x: 5px; y: 5px;
|
||||||
text: "x: " + myRect.x / 1px;
|
text: "x: " + myRect.x / 1px;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
x: 5px; y: 15px;
|
x: 5px; y: 20px;
|
||||||
text: "y: " + myRect.y / 1px;
|
text: "y: " + myRect.y / 1px;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
As the name suggests, Reactivity is all about parts of the user interface automatically updating or 'reacting'
|
As the name suggests, Reactivity is all about parts of the user interface automatically updating or 'reacting'
|
||||||
|
@ -124,18 +122,19 @@ export component MyComponent {
|
||||||
myRect := Rectangle {
|
myRect := Rectangle {
|
||||||
x: ta.mouse-x;
|
x: ta.mouse-x;
|
||||||
y: ta.mouse-y;
|
y: ta.mouse-y;
|
||||||
width: 40px;
|
width: 60px;
|
||||||
height: 40px;
|
height: 60px;
|
||||||
background: ta.pressed ? orange : white;
|
background: ta.pressed ? orange : skyblue;
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
x: 5px; y: 5px;
|
x: 5px; y: 5px;
|
||||||
text: "x: " + lengthToInt(myRect.x);
|
text: "x: " + lengthToInt(myRect.x);
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
x: 5px; y: 15px;
|
x: 5px; y: 20px;
|
||||||
text: "y: " + lengthToInt(myRect.y);
|
text: "y: " + lengthToInt(myRect.y);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue