Replies: 2 comments 3 replies
-
Do you have the code for this example? That would make it clearer what you actually want to do. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Would this get you started? import { Button, HorizontalBox, ScrollView, AboutSlint } from "std-widgets.slint";
export component Demo {
property <string> positional-color: "red";
height: 100px;
HorizontalBox {
ScrollView {
VerticalLayout {
red := Rectangle {
background: Colors.red;
height: 200px;
}
green := Rectangle {
background: Colors.green;
height: 200px;
}
blue := Rectangle {
background: Colors.blue;
height: 200px;
}
}
changed viewport-y => {
if self.viewport-y <= -400px {
root.positional-color = "blue";
} else if self.viewport-y <= -200px {
positional-color = "green";
} else {
positional-color = "red";
}
}
}
Text {
text: root.positional-color;
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Like:
Beta Was this translation helpful? Give feedback.
All reactions