mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-17 13:58:05 +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,21 +22,19 @@ export component MyComponent {
|
|||
myRect := Rectangle {
|
||||
x: ta.mouse-x;
|
||||
y: ta.mouse-y;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: ta.pressed ? orange : white;
|
||||
}
|
||||
|
||||
Text {
|
||||
x: 5px; y: 5px;
|
||||
text: "x: " + myRect.x / 1px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
Text {
|
||||
x: 5px; y: 15px;
|
||||
text: "y: " + myRect.y / 1px;
|
||||
color: white;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background: ta.pressed ? orange : skyblue;
|
||||
Text {
|
||||
x: 5px; y: 5px;
|
||||
text: "x: " + myRect.x / 1px;
|
||||
color: white;
|
||||
}
|
||||
Text {
|
||||
x: 5px; y: 20px;
|
||||
text: "y: " + myRect.y / 1px;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -124,18 +122,19 @@ export component MyComponent {
|
|||
myRect := Rectangle {
|
||||
x: ta.mouse-x;
|
||||
y: ta.mouse-y;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: ta.pressed ? orange : white;
|
||||
}
|
||||
|
||||
Text {
|
||||
x: 5px; y: 5px;
|
||||
text: "x: " + lengthToInt(myRect.x);
|
||||
}
|
||||
Text {
|
||||
x: 5px; y: 15px;
|
||||
text: "y: " + lengthToInt(myRect.y);
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background: ta.pressed ? orange : skyblue;
|
||||
Text {
|
||||
x: 5px; y: 5px;
|
||||
text: "x: " + lengthToInt(myRect.x);
|
||||
color: white;
|
||||
}
|
||||
Text {
|
||||
x: 5px; y: 20px;
|
||||
text: "y: " + lengthToInt(myRect.y);
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue