-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert when using %
sizes in Flickable
#4163
Comments
Thanks for the report - this looks indeed like a bug.
That's a good question... This would happen if an element uses a percentage width or height binding ( Do you have any percentage width/height bindings? Could you check what the surrounding code looks like? (and paste it here, if possible - just an excerpt) @ogoffart Do you have any idea what could cause this? |
A lot changed in 1.3 with regards to height and width properties. But it would be useful to have some code that reproduce the issue so we can debug it. |
In order to be able to debug this issue, i'd need to access some code that reproduces the issue. |
@ogoffart I ran into the same error in slint 1.3.1, and here's an example to illustrate it:
cargo.toml [package]
name = "xxx"
version = "0.1.0"
edition = "2021"
[dependencies]
slint = "1.3.1"
[build-dependencies]
slint-build = "1.3.1" main.rs slint::include_modules!();
fn main() {
MainWindow::new().unwrap().run().unwrap();
} appwindow.slint import { ListView } from "std-widgets.slint";
component ShowResult inherits Rectangle {
width: 50%;
height: 100%;
VerticalLayout {
ListView {
for file[idx] in [1,2,3]:Rectangle {
height: 20px;
// width: parent.width; // change to this line compiles fine
width: 100%; // An error occurred!!!
}
}
}
}
export component MainWindow inherits Window {
width: 326px;
height: 326px;
HorizontalLayout {
width: 100%;
height: 100%;
ShowResult {}
}
} |
Hello, My UI is composed of more than 100 files, so it's hard to share, but my code is similar to the one copied as an example by "ian373". Why does the percentage no longer work? |
Another tip: the Slint preview is still working, but I can't compile the code.
|
It works with the preview because this is a debug_assert failing and the preview is compiled in release. The failling code can be reduced to this:
What should the 100% be relative to? To the viewport or to the flickable?
And this fails for the Flickable viewport because |
The viewport of a flickable is of ElementType::Native, and `lookup_property` don't query the builtin reserved properties in that case. This commit fix the assert by allowing Type::Invalid as well. Fixes #4163
Hello, I modified all my pages this morning (outch!) and now it works. |
%
sizes in Flickable
The viewport of a flickable is of ElementType::Native, and `lookup_property` don't query the builtin reserved properties in that case. This commit fix the assert by allowing Type::Invalid as well. Fixes #4163
The viewport of a flickable is of ElementType::Native, and `lookup_property` don't query the builtin reserved properties in that case. This commit fix the assert by allowing Type::Invalid as well. Fixes #4163
Hello,
I'm having a problem compiling my Rust application after upgrading to Rust+Slint without modifying the code.
I was using the "Slint 1.2" version before the update. Now the application no longer compiles and returns the error:
Config:
OS: macOS 14.1.1 (23B81)
Language: Rust 1.74.1
Slint: 1.3.2
Slint-build : 1.3.2
What differences between the two versions could cause this?
(app code is really too big to be shared).
Thanks already.
The text was updated successfully, but these errors were encountered: