December 18, 2024 by Slint Team

Slint 1.9 Released with Revamped Documentation, New Live-Preview Element Inspector, and Translation BundlingBlog RSS


Slint is a native GUI toolkit written in Rust, with APIs in Rust, C++, Python, and JavaScript, designed for fast and responsive applications on all platforms.
Today, we've released 1.9! This version features a completely revamped documentation system, a new element inspector in live-preview, support for bundled translations to simplify localization, and much more.

Documentation Revamp

We've rebuilt our documentation from the ground up, now powered by Astro and Starlight. This fundamental redesign brings substantial improvements:

  • Visual and structural refresh.
  • Enhanced search and results.
  • Improved page-load times.

The new structure accommodates different learning preferences:

  • A comprehensive guide providing an overview of the Slint language.
  • A detailed reference for technical specifications.
  • A tutorial for those who prefer learning by doing.

But we're not done yet; we're setting up a foundation for continuous documentation improvements. This new backend opens up opportunities for expansion and provides easy maintenance. Our roadmap includes additional example snippets, more in-depth content, and comprehensive tutorials.

Screenshot of Text element reference docs with improved code snippets and screenshots.

New Element Inspector in Live-Preview

In the element section mode we've now added a context menu, showing what's underneath the mouse cursor, in hierarchical order and with the given element names. When working with deeply nested user interfaces, use the filter for convenience.

Element inspector live in action: Quickly navigate to the place in the code where the image is defined.

Bundling Translations

Translating a Slint application requires the gettext library as well as deploying the .mo files alongside your executable. In this release, we've removed this requirement, introducing the option to bundle translations: The translations from .po files can now be embedded directly into your executable during the build process. This feature is ideal for platforms like WebAssembly or microcontrollers.

Configure translation bundling in CMake with the SLINT_BUNDLE_TRANSLATIONS target property, or use the API from the slint-build crate when using Rust. At runtime, select from the bundled translations programmatically.

PopupWindow Improvements

We've received a lot of feedback for the PopupWindow element, particularly it didn't meet use-cases beyond the ComboBox. So we sat down and spent some quality time with it:

  • It's now possible to show multiple PopupWindows at the same time, in a hierarchy. Closing one PopupWindow restores focus to the element that was previously focused.
  • For fine-grained control over the closing behaviour, we've replaced the click-on-close boolean property with a close-policy property. For example, use PopupClosePolicy.close-on-click-outside to close the popup automatically if the user clicks outside or presses the escape key.
  • Popups are now also automatically placed within the Window to remain visible and not be clipped by the window edges.

Building on these improvements, we've begun work on context menus and menu bars, which we'll feature in an upcoming release. Stay tuned.

Named Arguments in Callbacks

You can now specify names of arguments for callback signatures, for improved readability. Then, our language server auto-complees them and displays them when hovering over the callback. But these names don't have any semantic value.

callback select-element(file: string, offset: int, x: length, y: length);

Other Noteworthy Changes

Thanks to numerous contributions, this release also features many new APIs and several bug fixes.

  • Rust: Use the new BackendSelector to specifically select a built-in backend and renderer for your application needs. (Thanks to @ianhattendorf)
  • On Linux, the winit backend now picks up the desktop's color scheme and reacts to changes.
  • Rust: PhysicalPosition and related types are serializable with serde. (Thanks to @Enyium)
  • ListView: Fixed init and changed callbacks not being invoked correctly.
  • Animations now support a direction (Thanks to @SK83RJOSH).
  • Arnold Loubriat contributed many new accessibility properties and fixed various widgets to use them.
  • Various fixes to the timers to prevent panics.
  • In our repository, we've separated demos from examples. Have you seen our new Home-Automation demo?

Get Started & Upgrading

To start using Slint 1.9, you can upgrade by following the instructions attached to the GitHub release.

With this release, we hope to make Slint even more powerful and user-friendly for developers building modern, performant UIs. Be sure to check out the full ChangeLog for more details. As always, we welcome your feedback and contributions. In particular, thanks to the following contributors!
@milianw
@DataTriny
@asuper0
@crai0
@BrandonXLF
@SuchAFuriousDeath
@wuwbobo2021
@burbokop
@teknalb
@ianhattendorf
@SK83RJOSH
@hongquan
@Qubi0-0
@0x6e
@renatofilho
@Enyium
@otiv-willem-vanhulle
@TheColorRed
@task-jp
@ubruhin
@davehorner

Happy coding!


Comments

Slint is a Rust-based toolkit for creating reactive and fluent user interfaces across a range of targets, from embedded devices with limited resources to powerful mobile devices and desktop machines. Supporting Android, Windows, Mac, Linux, and bare-metal systems, Slint features an easy-to-learn domain-specific language (DSL) that compiles into native code, optimizing for the target device's capabilities. It facilitates collaboration between designers and developers on shared projects and supports business logic development in Rust, C++, JavaScript, or Python.