Currently, it is a bit limited in the amount of property that it removes
because it will not remove property that are used by properties being
removed, or will consider setting properties as an usage
We need to do the ensure_window pass before the binding_analysis
otherwise the with and height property of the root element
will be considered as constant and will not adapt to the window size.
Unfortunately we can't really test that now because our test system
doesn't really test the Window, but here is a testcase:
```
MainWindow := Rectangle {
preferred-width: 400px;
preferred-height: 400px;
background: yellow;
VerticalLayout {
Rectangle {
background: red;
Text { text: root.width / 1px; }
}
}
}
```
(we should see the red rectangle)
The pass must be done at the begining so that synthetised property don't
become public, and also so that analyses pass can use the public api information
This removes the need to manually register fonts. This is initially
applied to the printer demo, but the other demos and removal of the
public manual registration API will come in follow-up commits.
This reverts commit 2dcbc45cd6.
It breaks loading of the printer demo in the editor because in
import_file we fail to return the absolute path and thus end up
importing common.60 too many times.
This also makes the focus() method available as a member function on any
item, but the resolve_element_reference_in_set_focus_calls() pass will
check if the elements are valid.
The check for `has-focus` to determine a focusable item was replaced
with an annotation on the built-in elements, so that `has-focus` can
later be implemented as a built-in function through the run-time,
without the need for a boolean property.
Don't just try to resolve relative paths against the current path,
resolve them against all directories in the include search path.
Together with the include search path directive for tests in tests/cases
this will allow working around the fact that the base directory for the
rust tests is different than for the C++/NodeJS tests.
We need to embed resources in wasm builds. Unfortunately we can't detect
that we're called by say wasm-pack and "TARGET"/"HOST" only works inside
build.rs. So instead, to keep things simple, this change always embeds
the image resources when targeting Rust.
The `SIXTYFPS_EMBED_RESOURCES` environment variable can be used to
override this anywhere for any language.
Fixes#130