-
Notifications
You must be signed in to change notification settings - Fork 788
Open
Labels
a:compilerSlint compiler internal (not the codegen, not the parser)Slint compiler internal (not the codegen, not the parser)a:layoutsRelated to the layouting and positioning of the elements (mO,bT)Related to the layouting and positioning of the elements (mO,bT)
Description
Edit: The panic is fixed, but the remaining bug is that element in if or for don't propagate their layout constraint to the parent when not in a layout.
That is:
Flickable {
HorizontalLayout { Rectangle { height: 55px; } }
} Works, but
Flickable {
if true: HorizontalLayout { Rectangle { height: 55px; } }
} Doesn't work as the geometry of the child is not used
Workaround: use a layout: #407 (comment)
The Slint code, tests, and docs reference this issue (git grep #407 to find them)
Notably, the fix should be around there:
| // FIXME: we should ideally add runtime code to merge layout info of all elements that are repeated (same as #407) |
Original issue:
The following minimal test-case causes a panic in the compiler in the generators/interpreter:
export Testcase := Window {
preferred-width: 640px;
preferred-height: 480px;
Flickable {
for blah in 1: HorizontalLayout {}
}
}A call to unwrap() at the end of access_member panics:
access_member(
element,
name,
&component
.parent_element
.upgrade()
.unwrap() // <-- this panics
.borrow()
.enclosing_component
.upgrade()
.unwrap(),
quote!(#component_rust.parent.upgrade().unwrap().as_pin_ref()),
is_special,
)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
griffi-gh
Metadata
Metadata
Assignees
Labels
a:compilerSlint compiler internal (not the codegen, not the parser)Slint compiler internal (not the codegen, not the parser)a:layoutsRelated to the layouting and positioning of the elements (mO,bT)Related to the layouting and positioning of the elements (mO,bT)