Closed lifeRobot closed 6 months ago
Thanks for the bug report. I can't quite reproduce this. It works for me on Slintpad, as well as on macOS, and Windows.
But I see in your clip that it isn't working for you, which makes me wonder if this could perhaps be a performance issue.
I'm trying to run on the above .slint file with slint-viewer
. Could you try the same and see if it works if you pass --release
, i.e. cargo run -p slint-viewer --release -- \path\to\test.slint
(in the slint git repo clone)?
Thanks for the bug report. I can't quite reproduce this. It works for me on Slintpad, as well as on macOS, and Windows.
But I see in your clip that it isn't working for you, which makes me wonder if this could perhaps be a performance issue.
I'm trying to run on the above .slint file with
slint-viewer
. Could you try the same and see if it works if you pass--release
, i.e.cargo run -p slint-viewer --release -- \path\to\test.slint
(in the slint git repo clone)?
[package]
name = "slint-rust-template-main"
version = "0.1.0"
authors = ["123"]
edition = "2021"
build = "build.rs"
[dependencies] slint = "1.4"
[build-dependencies] slint-build = "1.4"
build.rs file
fn main() { slint_build::compile("ui/appwindow.slint").unwrap(); }
main.rs file
slint::include_modules!();
fn main() -> Result<(), slint::PlatformError> { let ui = AppWindow::new()?.run() }
.slint file copy from example code
### analysis
Perhaps it is due to the different loading method of slint by `slint_build::compile` + `slint::include_modules!();` compared to `slint-viewer`
Thanks for the report. I can indeed reproduce the bug when compiled with rust (and C++) but not with the viewer.
Smaller testcase:
export component MainWindow inherits Window {
width: 200px;
height: 200px;
if true: TouchArea {
clicked => {
line.x = 100px;
}
}
line:= Rectangle {
x: 0px;
y: 5px;
width: 20px;
height: 2px;
background: blue;
animate x {
duration: 300ms;
}
}
}
Looks like the if
or for
prevent the animation from working correctly
slint 1.4.1, windows 11
animate code
animation does not take effect full code(.slint)
the animation effect of the rectangle in the following code does not take effect, code from @jui/nav/tabs.slint
code running effect
20240303190115.webm