Compile test the result of an element move in the `can_move` function
to catch all cases where the move would be problematic.
Shuffle some test code around to allow for testing this new
functionality.
Use this snapshot to keep a unoptimized typeloader around, so that the preview
does not need to do another parsing run.
Move the document cache in the preview over to use the snapshot.
The Document cache is a specialized typeloader now, make it provide the
necessary APIs directly, so that we can be sure nobody will do anything
that breaks the data:-)
Now that we move elements with ids, lets also move conditional and repeated
elements.
They have the same problem as elements with ids: They will probably break when
moved into different elements.
Add a placeholder Rectangle into a layout whenever the last eleemnt is removed.
This makes sure we can drop into the Layout again.
Add infrastructure to find the parent element to ElementRcNode and move more
code into the ElementRcNode.
Updated the version from 1.1 to 1.2
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
... so we can have a better idea what we need to visualize.
Move the decision on which color to use into the slint file as well:
A designer should make that call, not a developer ;-)
Only the hand-picked sensible things, not all of it ;-)
Also fix a few typos that cspell complained about when I
tried to commit and some formatting changes that cargo fmt
insisted on when commiting.
Add `fills_aprent` and `default_properties` to
`ComponentInformation`. The first is a bool showing
whether the Component will fill its parent or not.
The later is a set of properties that the UI will set
when the widget gets dropped.
Refactor the data passing a bit: Keep the data on known
components around. Pass only the component name into
the UI, but pass the entire `ComponentInformation` to
the `drop_location` methods.
Slpit up `lookup_type_for_child_elemnt` (in the compiler) into the
part that looks at the element itself only (called `accepts_child_element`)
and the part that looks at the child.
When deciding whether we can drop something into another element in
the live preview, we know the child type is going to be OK, even when
the `TypeRegister` does not contain it yet (as it is not imported yet).
We recently got better support for inlined elements. Use
The `ElementRcNode` when accessing properties, so that
we can actually have a better idea which SyntaxNode we
need to work on.
This is actually not too critical as the LSP does little
inlining, but I wanted to reuse this on the preview side
as well, which does inlining much more aggressively.
Do NOT access properties in the live preview though:
It is heavily optiomized, so most properties are just
gone there;-)
Allow moving and resizing of elements provided:
* The element is not layout. This approximates
"fills its parent", which is what we aim for once
we can query type info rom within the Preview.
* The element is not *inside* a layout