-
Notifications
You must be signed in to change notification settings - Fork 567
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
layouting constraints not respected for items in if
or for
#407
Comments
The problem is trying to estimate the size constraints of the Flickable based on the inside, but the inside is a repeated expression. More complicated fix would be to take them into account. |
I wonder what "taking them into account" would look like anyway. All constraints simply merged? But even if the above would generate an error ("not currently supported") instead of panic it would be an improvement :) |
…avoid compiler panic This fixes a panic but ideally, we should merge the layout info of each children cc #407
I've fixed the panic, but we should still take into account the size. It is strange that
and
have different preferred-height or viewport-height. |
I'm hitting issues with this I think, but in my case it's with the fact I want a vertical list generated from a for loop to be vertically flickable. Every attempt unless I set the parent size ends up with compacting my items vertically and making the flickable horizontal only. I really don't desire to set the parent size and would like the total size to be vertical view constrained but fit to width of largest item. |
Actually the precise issue I have is that I need the children of the for loop to set the parent rectangle width: Like so (removed spacing, paddings etc):
I've worked around it by specialcasing a set list length, but it's not ideal at all. Flickable works great in other places where I've got a set dimension, but not here where I really want it to have width automatically set. |
if
or for
In order to fix this bug, one would need to address the FIXME in slint/internal/compiler/passes/default_geometry.rs Lines 185 to 187 in b8c3bbe
Grepping for |
What would be the current workaround if the items generated by a for loop don't have a predefined height? |
Use an explicit layout. Instead of
Use
|
Edit: The panic is fixed, but the remaining bug is that element in
if
orfor
don't propagate their layout constraint to the parent when not in a layout.See comment #407 (comment)
Original issue:
The following minimal test-case causes a panic in the compiler in the generators/interpreter:
A call to
unwrap()
at the end ofaccess_member
panics:Edit: Panic was fixed, but the layouting info of the inner repeated elements are not taken into account when they should
See FIXME in tests/cases/layout/issue_407_for_layout_in_flickable.60
The text was updated successfully, but these errors were encountered: