PR #642 fixed making the window not resizable when it has initially a
fixed size. This change applies a different logic with the same
resulting effect when the window item changes later, for example when
transiting in the live-preview from a fixed size to a resizable window -
by looking at the min/max constraints.
There was a warning in the C++ generated code in the tests: (in test_cpp_image_geometry)
```
/tmp/.tmpsAMWqZ.cpp:307:85: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare]
this->image_in_layout_fit_ok.set((sixtyfps::cbindgen_private::ImageFit::contain == sixtyfps::cbindgen_private::ImageFit::contain));
^
```
Deoing some simple evaluation prevent this warning at least
This will allow later to be able to operate on the binding despite the
element is borrowed.
Since the Binding itself is in a RefCell, the analysis don't need to
be anymore.
To do this change, a small change in the binding_analysis logic was required
which means that we will now detect binding loop if a binding was causing
two binding loop. (before, only one binding loop was detected)
Somehow the focus_change_subcompo test missed this case and the visible
issue of this off-by-one was that
the combo boxes in the printer demo's settings page opened at the wrong location (wrong parent).
We use the setup_code for that for now, so apply the same logic as in the C++ generator.
However there's more work to be done later to make forward-focus work corectly into sub-components.
Consider this code:
```60
Foo := Rectangle {
animate y { /*...*/ }
x: some_binding;
}
Bar := Rectangle {
foo_instance := Foo {
y: some_binding;
animate x { /*...*/ }
}
}
```
We need to make sure that the binding are set with the right animation.
FIXME: the generator should actually handle this case without needing for inlining.
Also, this currently do not work if there is several level of "inheritence"
If there is a Expression::Invalid as a binding (because it has an animation,
for example) we must check that the binding expression in the base is not
constant.
This fixes the rust test `properties_animation_merging` without inlining
(The o4_val was considered constant despite it shouldn't be)
```
error[E0599]: no method named `unwrap` found for struct `sixtyfps::re_exports::OnceCell` in the current scope
--> .../test-driver-rust-0868c471dd25beed/out/imports_external_type.rs:384:29
|
384 | &_self.root.unwrap().upgrade(),
| ^^^^^^ method not found in `sixtyfps::re_exports::OnceCell<VWeak<sixtyfps::re_exports::ComponentVTable, imports_external_type::sixtyfps_generated_TestCase::InnerTestCase>>`
```
Treating the Tab key as text disallows handling Shift-Tab because
the shift modifier will not be passed down. This makes the
handling of Tab analogous to Escape, Return and other non-text
keycodes.
* Generate a visit_dynamic_children dispatch function in sub-components and call it
* Add a self_weak to sub-components
* Fix access to the window from within repeated components
* Fix the parent type of repeated elements within sub-components to be a VWeakMapped instead of VWeak
* Fix the build of the parent_item() implementation of repeated elements within sub-comps. The parent index might still be wrong, needs to be checked.
We generate a getter that hides the renaming. Instead of returning a field offset, we
might as well use the same code as for the value getter
and return a `Pin<&Property<T>>`.
What doesn't work yet are aliases to globals, because that
uses a temporary.