21st of March 2022 to 27th of March 2022

Slint UI Library

Keyboard handling on the Web

The big feature this week was making text input fields work with mobile browsers. This is done by adding an hidden <input> element to the WASM GL backend, which makes the browser show the virtual keyboard. This has been a pain point ever since the mobile WASM support was added.
As a result, you can now type text in our gallery or todo examples in mobile browsers.

PRs: #1086, #1101

Graphics Optimizations

The Open GL backend saw performance optimizations this week.

Animations are more targeted now: Instead of the content of all windows getting invalidated on an animation tick, only those that actually contain the animation get redrawn now. (#1087)

We added a cache-rendering-hint property to the Slint language, that you can set on any element. It provides a hint to the renderer that the element and all of its children should be rendered into a cached layer texture (#1075). For complex sub-trees of elements that rarely change, this can speed up rendering performance a lot. This is implemented for the GL as well as the Qt renderer.

New Features

  • Make it possible to disable the slint compiler from the CMake build (df2d64)

    This isn't always needed, for example when using only the interpreter API, and its dependency to native libraries on Linux (namely fontconfig) makes it difficult to cross-compile with CMake.

    While cargo is invoked correctly for the native binary build, the library search paths coming from CMake will be target specific, not host specific.

    So for now this provides a way of disabling the compiler.

  • Additional collection of metrics such as the number of created layers was added to the SLINT_DEBUG_PERFORMANCE output. This can be helpful when optimizing rendering performance of Slint.

Fixes

  • Error out when a PopupWindow is in a if or for instead of panicking(6c7a7a )

    We need to move stuff in the parent element and that doesn't work if it is a repeated element. Also there would not be ways to call show on it anyway.

    Fixes #1079

  • Fix animations not running in secondary windows with wasm (e93504)

    When a second canvas is visible, only animations in the first canvas resulted in updates and visible animation. An animation in the second canvas wouldn't result in repaints.

    When we start an animation, we request a redraw on all windows and return with ControlFlow::Poll to winit.

    Winit then schedules an animation frame request, and in the callback the redraw request events are delivered. For the first window we call update_animations(), a new tick is detected (different than the previous one) and animated properties are dirty and yield new windows.

    Then right away we get called again with a redraw request for the second window. update_animations() determines that the instant::now() is the same, and has_animations() returns false. So at the end of the event handler we return fail to return Poll and therefore no animation frame request is created, which means the animations just stop.

    Fix this by calling update_animations() only once, when all input events have been processed and the redraw events are up for delivery next.

    This is visible in the preview canvases in the documentation, if a canvas other than the first has animations.

  • MCU: fix text being cut in the printer demo sometimes being cut off (#1083)

Statistics

42 patches were committed by 4 authors.

← Next : 29th of March 2022 to 4th of April 2022 | Previous : 14th of March 2022 to 20th of March 2022


Slint is a declarative GUI toolkit to build native user interfaces for desktop and embedded applications written in Rust, C++, or JavaScript. Find more information at https://slint.dev/ or check out the source code at https://github.com/slint-ui/slint