The test's build.rs invokes the compiler repeatedly with a configuration that enables font embedding. Instead of loading the same font with fontdue repeatedly (slow), store the loaded fonts in a hash table for re-use.
This should not have any impact on single file compilations, but it helps with the screenshot driver test dramatically, bringing down the time of
touch tests/screenshots/build.rs
cargo build -p test-driver-screenshots
on my xps13 linux from 1m26s to 15s.
Commit 3764312561 accidentally chained filter_map so that the list of default (fallback) fonts was empty. That resulted in
a simple hello world (with no custom fonts) embedding no font at all and causing a run-time error.
Instead of replacing the existing x/y properties with "invisible" ones, let's just keep those that we have and merely zero out the geometry x/y.
This has the bonus that access to x/y within the PopupWindow will provide the right value, i.e.
popup := PopupWindow {
x: 42px;
Text { text: popup.text / 1px; }
}
will show "42" instead of zero.
Since x/y are now merely referenced via the NamedReferences in PopupWindow, this patch also fixes the property materialization pass to use
visit_all_named_references(component) to also visit the x/y named refs,
instead of visit_all_named_references_in_element() that skips them.
Regressions since 2fd8744cfc that disabled
the pass that maps the URL with the resource_url_mapper.
Even if we don't embed the ressource, we must still go through them to
map them
Have a warning when a component is exported from the main file and
doesn't inherit Window.
Unless it's the last component, for compatibility with Slint 1.6
Also don't warn in the interpreter
This reverts commit 66652cdc1d.
The warning in the gallery are hard to fix because the component inherit
from a layout and there is nowhere to place the popups
Preparation for multi-components
Note that this had to rename one instance of TextStyle because it
conflicts with the struct of the same name used in the FontSettings
in the style. This wasn't a problem before because it shares some
property in common, and the the order of processing of component has
changed leading to the other one being generated.
(But that is a wider bug in the compiler outside of the scope of this
refactoring)
The compile_syntax_node was used by the syntax_test in case of error
to still cover the coverage, but commit e3908cfce6
made this function a noop when there is an error already.
The LSP does try to build an object tree even though there are error in
order to have the most information even in that case, so we must ensure
that it doesn't panic left and right.
This commit also fix some of these panics.
ammend previous commit to fix building the examples
When inlining things inside a Popup, we must process the popups first.
But in order to inline the popup inside another component, we must
process the popups last.
This makes the code a bit more complicated
Keep merging elements, but remember the boundaries in the debug info, separated by a slash.
Also fixed tests that rely on accessible-label being set only once. For example
```
Button { text: "foo"; }
```
will certainly have "foo" as accessible-label on `Button`, but its internal `Text` element has
an implicit "accessible-label" set to the same
value.
So don't rely on that for now but search by id instead.
Otherwise the access to the PopupMenu parent will fail to compute the
x,y position of the popup as the popup's reference the Row as its
parent.
Fixes#5259
This regressed in commit 12d904a71c
which changed the order of the pass to get the lower_popup pass before
the first inlining pass.
If by chance (which is likely if one have children), the component that
inherits from PopupWindow was inlined in that pass, it would be as
if it was not a component, and it would be removed from its parent.
But since it is no longer inlined, we need to support that case and
delay the removal when processing the component that holds that popup.