The added functions enable mixing colors and manipulating the opacity
of colors and brushes.
They enable the behavior of some of the available functions from SASS and are
added for future use for adding the Adwaita style (future PR).
Move the decoding and forwarding state into a struct, instead of keeping it in closure captures.
This way we can also make it generic over different output types.
After creating the winit window we end up issuing a request_redraw() on
the window adapter after setting the component. This is before show().
With regular windowing systems the redraw event will be delivered when
the window is actually shown, but winit delivers it right away.
In our draw() implementation we don't do anything before show() is
called, as the size won't be correct.
Therefore content is never rendered.
To work around this behavior, we can use the redraw_requested state and
draw right away in show() on wasm.
After commit 7df902b53c, the winit window
is not created when calling show() anymore but it's now created at
component creation time. That means the event loop workaround removed
in 459f810bd8 is now needed at
construction time.
Since this is a winit and wasm specific issue, it's now dealt with in
the wasm interpreter implementation, by invoking the creation from the
event loop from there and returning a promise in the API.
This changes the API therefore: create() can only be called after the
event loop is running.
In the compiler this is still very primitive, but an attempt to start a
generic interface. The basic assumption is that all item functions will
eventually need access to the window adapter and itemrc. Support for
additional arguments is still missing.
Also missing is support for the function access via rtti in the
interpreter, hence the hardcoding at the moment.
With Qt and eglfs it may happen that when creating a popup, Qt delivers
a paint event via show() before we've had a chance to set the component
on the slint::Window. In that case unwrapping the component in
draw_contents() panics.
This fix is covered by reproducing the same scenario using public
MinimalSoftwareWindow API.
Fixes#2799
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
In the screenshot tests this works by setting SLINT_DEFAULT_FONT to
pointer to a directory, instead of a file. We then load all fonts in
that directory and consider their families the default unless a family
is specified. This way for "Noto Sans" a regular as well as an italic
version is registered in fontdb and returned in the list of font
fallback ids. embed_glyphs in the compiler then embeds those variants
and we find them at run-time.
- Mention in the type mapping table as well as in ModelRc that ModelRc is also used for array struct fields.
- Use an itemized list for the different ways of constructing, with the from_slice variant being listed second.
cc #2787
We would pass `physical_size_to_slint(&self.winit_window().inner_size())`, which is
identical to `slint::Window::size()`, which
calls `size()` on the WindowAdapter, which
returns the above.
show() used to create the window, which required access to the event
loop (target), which in turn required workarounds like in #1603. Since
the winit window exists now in show(), we don't need this workaround
anymore.
The same applies to hide(), we don't need an event loop target, all we
need is the event loop proxy to dispatch a WindowHidden event.