mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 14:51:15 +00:00
Use transitions in the printer demo for the color level
This commit is contained in:
parent
3cd84473e2
commit
57cf4e0988
1 changed files with 11 additions and 3 deletions
|
@ -207,11 +207,19 @@ MainWindow := Window {
|
|||
color: white;
|
||||
Rectangle {
|
||||
width: parent.width;
|
||||
height: tentative_height > parent.height * color_info.level ? parent.height * color_info.level: tentative_height;
|
||||
property <length> tentative_height: root.active_page == 0 ? parent.height * color_info.level : 0phx;
|
||||
animate tentative_height { duration: 750ms; easing: ease_in_out; }
|
||||
height: parent.height * color_info.level;
|
||||
y: parent.height - self.height;
|
||||
color: color_info.color;
|
||||
states [
|
||||
innactive when root.active_page != 0 : {
|
||||
height: 0phx;
|
||||
}
|
||||
]
|
||||
transitions [
|
||||
out innactive : {
|
||||
animate height { duration: 750ms; easing: ease_in_out; }
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue