Skip to content

ability to embed slint component from different source #2390

@ogoffart

Description

@ogoffart

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:

  1. exit the event loop with a specific error saying this hapenned
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rfcRequest for comments: proposals for changesroadmapTickets that we can use for roadmapping

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions