With just the Qt accessibility support, this is not impactful.
But with accesskit it'll be useful to avoid the intermediate vector of ItemRcs
and map directly to a different data structure.
Otherwise, this is a trade-off between the stack allocation of the recursion and
instead allocating the stack of pending itemrs
on the heap.
This will be needed for embedding - to avoid creating two window
adapters - and it will be needed for the API to allow creating a
component from an existing window.
- in SetRenderingNotifierError using a rustdoc link breaks the C++ docs. Using a qualified backtick'ed slint::Window works perfect with both.
- In TimerMode, the same track unfortunately doesn't work with a function,
but we can use [`Foo::bar()`] to make the link work with rustdoc and myst-parser.
The look isn't perfect in C++, the square brackets are visible.
.. that has less items and the ListView is scrolled.
We should not have an offset that is higher than the current count
otherwise we're going to access invalid item in the model
Fix#2780
When the TextInput item is read-only, it should not report availability
or any other status to the input method via the window adapter.
This also fixes the order of events when clicking on a TextInput: We
would send the ime position update request before enabling the ime,
because we set the focus _after_ setting the cursor pos.
Fixes#2812
This patch adds a `close()` function that can be called to close a popup
window, and a `close-to-click` boolean that can be set to false to
disable the default behavior.
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).
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
Add WindowEvent::ScaleFactorChanged and made set_scale_factor on
WindowInner private.
This achieves what #2486 tried to do, but using the clean platform
window event interface.
* add screenshot test for text input
* Update tests/screenshots/cases/software/basic/text_input.slint
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
* swr: fix clipping of text cursor
---------
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>