* live-preview: More filter options in Selection Popup
* Hide layouts,
* Hide interactive elements
* Hide others
@szecket did a lot of UI polish that I just merged here
so that I do not need to show what I made!
* live-preview: Remove TouchArea suffix
Add a filter into the Selection popup to filter out
anything not matching.
If all letters are lowercase, then it will do a case-insensitive
match, if there are non-lowercase characters it will do
case-sensitive matching instead.
Have the selection popup actually highlight the hovered
object in the editor.
We did not have this use case before: We used to either
highlight after an update or never at all. Neither semantic
matches what we are doing in the selection popup, so I added
a highlight-now flag.
... that provides a model containing all the elements
at a position sorted from "front" to "back" with extra
information so that we can present the data in a nice UI
in the next step.
The selection code now filters out builtins and ignore nodes
when collecting nodes. So the following filter step does not
need to take those into account anymore.
Whether a selection candidate is actually a part of the root
component or not is now handled by looking at whether the
elements text range is inside the root component's text
range. This is closer to what users expect to happen I think.
Unconfuse selecting something with a drop shadow. That is a
extra compiler-generated element that gets added before
the actual element we are looking for.
Filter out properties related to layouts that make no sense
for the current element. These are x/y coordinates and the
grid layout related properties.
It's tricky to do: The properties are looked up in the
context of the unoptimized DocumentCache, so that
(most) properties are visible. The layout information is
not available there though as base types are not resolved yet.
So the layout information is taken from the preview data.
I got carried away, I replaced `u32` with `TextSize` in one place
because that's what I got and I did not want to convert... and
then I fixed the fallout.
No functional change is intended in any of this.
FIXUP
Instead of having all style duplicated and re-using a base, we just hack
into the funciton that queries the dark/light theme based on the style
suffix known at compile time.
This removes one of the problem that happens when trying to work on the
widget style with the extension, as it relies on include path hacks
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"
Semi-random selection of clippy topics that were
uncontroversial before:-).
Leaves about 84 deduplicated issues in the code base
according to clippy from nightly.
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.
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
Now that we keep information on all nodes, use that to do more
"fine grained" selection: We select based on nodes, not elements in
the element tree now.
This assumes that a source locartion based on file path and offset in
that file is enough to define the nodes of an element.