Implement some very rudimentary font fallback handling and add some
the glyphs the puzzle needs.
The font fallback handling deserves to go into a module shared between GL backend and the compiler.
For the character selection we should scan the text elements for
literals just like we do for the font size.
This change of the design makes the tiles bigger (more finger friendly) and moves the
"tabs" and "controls" from the top and bottom to the left and right
hand side.
The over effect was removed from the check box as it sometimes stays.
Unfortunately the RNG on the stm32 may fail when called repeatedly in quick successsion - maybe it's running out of entropy.
That would result in the random moves being not random at all because we map the error to 0.
Instead, use rand's pseudo rng in the slide puzzle, seed it once (when it works) and
then re-use the rng throughout.
The quote crate doesn't escape the characters for the character map entry.
This causes problems with some of the characters we chose by default, and in
general (if we ever do coverage based) will break. So for now just store
the char strait as u32.
There's an opportunity to use different character map encodings to cover the
common case that we don't actually need u32, but that's not for this patch.
Command used to run:
```
SLINT_SCALE_FACTOR=0.6 SLINT_EMBED_GLYPHS=1 SLINT_FONT_SIZES=8,11,10,12,13,14,15,16,18,20,22,24,32 CARGO_TARGET_THUMBV6M_NONE_EABI_LINKER="flip-link" CARGO_TARGET_THUMBV6M_NONE_EABI_RUNNER="probe-run --chip RP2040" SLINT_STYLE=ugly SLINT_PROCESS_IMAGES=1 cargo +nightly build -p memory --no-default-features --features=i-slint-backend-mcu/pico-st7789 --target=thumbv6m-none-eabi --release && udisksctl mount -b /dev/sda1 && elf2uf2-rs -d target/thumbv6m-none-eabi/release/memory
```
Maybe not everything is needed (like there is no text)
Also need to add flags in .cargo/config because there is no build.rs
This requires us to flash the cache before swapping the frame buffer pointer.
With slide puzzle span drawing with image tiles goes from ~100ms down to ~50ms,
and theme switching between simple and berlin from ~140ms to ~72ms.
This is with the line renderer.
When computing the dirty regions, the call to geometry() might end up
querying a value that's computed by the layout. For the layout
computation we might end up calling ensure_updated() on a repeater,
which then might destroy components. The destruction involves freeing
cached dirty rectangles (via free_graphics_resources), and that also
requires a write access to the cache. So after retrieving the property
tracker for the dirty geometry, drop access to the cache before calling
geometry().
We publish to OpenVSX first and if that succeeds then we publish to vs code market place.
The former sometimes times out, where the publishing actually succeeds but the GH
action step fails. Thus we never run the VS code market place step.
Swap the two steps as a starter and equip the OpenVSX step with continue-on-error: true
as at that point we have built the package, just publishing failed.
When using repeaters - like in the slide puzzle - and during renderer a component
gets deleted, we call free_graphics_resources and try to free
the dirty rectangle list in the partial renderer cache. At that point the cache is
already mutably borrowed, which causes a panic.
As remedy, apply the mutable borrow more fine grained and not right when calling
render().
Implement basic accessibility (a11y) support, using the Qt backend.
_This should get us started, but accessibility support is an additional way to interact with UIs that is very different from the "graphical way" most users will interact with the UI. No single PR will "make a toolkit accessibility", this needs to be an ongoing effort!_
Parts of this PR:
* Add functions to access a11y-related properties to Component
* Add helper functions to Item struct
* Handle accessible- properties in the compiler
* Add documentation, add description, enforce some basic rules
* Make the Text element accessible by default
* Don't optimize away accessibility property in the LLR
* Ensure that accessibility property are marked as used
* Add some accessibility properties to the native style widgets
* Support for bool and integer `accessible` properties
* Implement basic support for accessibility
* Make basic widgets accessible by default
* Make slider focus-able and interactable with keyboard
* Tell a11y layer about value changes
* Generate QAccessible constants using bindgen
* Don't expose the `accessible` properties when using the MCU backend: There is no backend to make use of them
* Handle focus change based on keyboard focus of the window
* Report accessible widgets at correct positions
* Allow for (virtual) focus delegation at the a11y level
* Calculate value step size dynamically
* Make sure to not send notifications to a11y backend about dead objects
The generated code provides a PinnedDrop implementation that calls
free_component_item_graphics_resources. We must annotate the components
correctly to make sure to the drop implementation is called and graphics
resources are released.
Thanks to Jocelyn!
Fixes#1261