The synthetic window we "inject" in the ensure_window() pass did not
have the window-background from the style applied. This is visible
for example when viewing something like
Rectangle { background: blue; border-radius: height / 2 }
When an animate foo {} declaration ends up creating an synthetic, invalid BindingExpression,
we still need to give it a span, to ensure that the diagnostics
produced later have *some* location set.
Fixes#515
Copypasta's wayland clipboard requires a different API that we don't cater to yet, so
for now to fix the build, disable the clipboard (use in-app nop).
The GL backend defaults to enabling X11. The default crate depends on
the GL backend but it doesn't specify default-features = false,
therefore x11 is basically always enabled.
In line with commit 1fd8c7236a, this
change makes sure that the defaults are defined in the tree entry
points: The Rust API crate, the interpreter crate and the CMake project
define the defaults. The latter already enabled X11 by default, but the
first two did not.
The checkmark and reload have always been missing in some circumstances.
The recent fixes with glyph coverage check helped, but they do not account for the fact that
characters like the check mark map to the same script (Common). So for these scripts
we need to perform an exact glyph coverage check.
Avoid the dance of using font-kit to re-discover the same .ttf file and
read it all into memory every time we need to render text where the primary font
provides insufficient coverage.
The font resolution function querying fontdb is fast now, so we can
always call it when rendering text. That way we don't need all the
indirection in the text_size(), etc. functions, we don't need an entry
in the item graphics cache for the font and we can avoid a lot of
property dependencies.
Instead of always mapping the face (from disk), first fan out existing
cached coverage information. Any unchecked scripts are then checked
in the slow code path with `with_face_data` later.
Don't generate the headers by default in the source directory, put them
into a sub-directory in OUT_DIR instead and convey that location via
links to the C++ test driver.
This reverts commit a79ee93ea9 and
re-instates the change of 3358841ab0, as
the dependency issue with generating the header files in time for make
install is fixed by running cbindgen in build.rs of sixtyfps-cpp,
instead of via xtask from cmake.
Make install would still trigger the generated_headers_target CMake
custom command - due to the use of add_dependencies - and that would end
up running cbindgen. That in turn breaks "make install" when it's run in
an environment that doesn't have cargo in PATH (for example when using
"sudo make install").
This patch folds the generation of the C++ header files into the build
of the sixtyfps-cpp crate - via build.rs. By default the headers are
placed in api/sixtyfps-cpp/generated_include but the CMake build
redirects that into the build directory.
Note: Due to the way that corrosion works, cargo is still run when
running "make install", but it's path is absolute and there should not
be any reliance on the PATH environment variable.
The upcoming re-organization of the C++ header generation requires the
use of the CORROSION_ENVIRONMENT_VARIABLES target property, which in
turn requires CMake >= 3.19.
Use the static (but long) fallback list that we get from fontconfig in the beginning.
This works, but can be optimized to operate on a trimmed and shorter list,
which will speed up the fallback. But for now this makes it work.
Unfortunately the text property was not included in the property dependency chain
for the cached Font.
This is fixed by delaying that with a getter function, but in the mid term
we should be able to remove this again once
femtovg learns lazy font resolution.
The basic idea is to use fontdb's load_system_fonts() mechanism, in
conjunction with its built-in mmap support, to get an overview over all
installed fonts on macOS, Windows and Linux.
This isn't quite perfect in terms of discovering systems defaults, but
it's much faster than font-kit's approach of querying the system (good)
but reading the matched files into memory (not using mmap). And we have
the option of perfecting it by using fontconfig directly on Linux (where
the backend is most important).
This also paves the way for better fallback handling, as now we have a
list of all available families and we can use system APIs to query for
fallbacks.
Disabling the build of any artefacts (examples, tests) that depend on the SixtyFPS target somehow
prevents generated_headers_target from being run.
The plan is to get rid of that target and run cbindgen in build.rs of the cpp
crate, but meanwhile re-enable the examples build by default.
Re-enable them in the CI (naturally), but with them off by default any
spurious compiler warnings in the tests won't break the build of users
and we don't clone catch2 and fmtlib by default.
Set QStyle::State_Active conditional to whether the window is active,
which maps to Qt's active window concept and winit's has-focus (until we
render popups differently).
It was impossible to see which tab was the current tab.
Ensure that we set State_Active, like we do for the other styled controls.
Later, the active state should be tied to whether the window is "active" or not.
In ComponentDescription only keep a exported_globals_by_name that
maintains the index in the compiled_globals vector and in there store
the public properties of global singletons.
The metrics properties and the implementation of layout_info needs to
strictly reading cross-axis properties to avoid circular dependencies.
This patch applies a INT_MAX / 2 on the cross-axis to QStyle when
querying. Mostly the styles appear to just add/subtract margins, so this
value should not produce overflows while still providing an
approximation of "infinite" :)
Fixes#412