Open
Description
Use case:
- Slint Editor
- Editor that allow to place Slint Component
- Dynamic widget from a model
- Dynamic load .slint files at runtime
We would introduce a new component
property type, and a Embed
builtin element:
component Editor {
in property <component> foo;
// ...
Embed { component: foo; }
}
The generated code for the setter would be something like
fn set_foo(_ : Option<impl slint::ComponentHandle>);
We should try to create the window adapter lazily because the Embed
will set it when the sub-tree is visited (by its surrounding WindowAdapter)
The geometry constraints are forwarded from the embedded component to the Embedd
element.
There will be a two way binding for the width and height of the Embedd element, and its component.
If a component is used several times, we need to do either:
- exit the event loop with a specific error saying this hapenned
- just print a error in stderr
The Embed should know its source location at runtime to give the developer some idea on where the error came from.