31st of January 2022 to 6th of February 2022

SixtyFPS UI Library

We had another busy week at SixtyFPS: We're going to make a new release release soon, so we did a lot of testing, polishing, documentation fixes and CI/CD improvements. This time we have more release work than usual: First off we will do a minor version number bump, so we also had to get some API incompatible changes merged that were not an option in the 0.1 series. Finally we plan to release the next version under a new name, so we were also very busy renaming crates, symbols, changing logos and such fun activities!

Of course we also need the website to also reflect the new name, so there was a lot of activity on that front, too.

We hope to be able to show all this work to the world this week!

Olivier wrote a nice little crate that parses your projects Cargo.toml file and generates nice documentation for all the features from that. This was published to crates.io and then used in some of our won crates. Go and check out document-features!

Simon kept himself busy with rendering OpenGL scenes below the UI rendered by SixtyFPS. This is done using the new rendering synchronization API in the upcoming release.

New Features

  • Add rendering callbacks to sixtyfps::Window (8959ea)

    This API allows specifying a callback that will be invoked when setting up graphics (great for compiling shaders), before rendering a frame (but after the clearing of the surface background), after rendering a frame (before swapbuffers) and when releasing graphics resources.

  • Add compatibility feature to our public crates (38d7ac)

    We want to be able to put existing functionality behind a feature flag while keeping the semver compatibility. This is only possible if that new feature flag is enabled by default, but this is not working if the users have done default-features = false in their Cargo.toml. So we add new compat-x-y-z feature that is mandatory to have and which is enforced with a compile_error!

    Now, users that whishes to not have the default features must enable it explicitly. Say we want only x11 but not qt and wayland, the user will do:
    sixtyfps = { version = "0.2", default-features = false, features = ["x11", "compat-0-2-0"] }

    Now, imagine that in the version 0.2.3, we put the SVG support behind a feature flag. we will do this in out Cargo.toml:

    [features]
    default = ["compat-0-2-0", "x11", "wayland"]
    compat-0-2-0 = ["compat-0-2-3", "svg"]
    compat-0-2-3 = []
    svg = [...] ...
    

    That way, the svg feature will be enabled by default for all the users who used previous version of SixtyFPS, and people that want to disable "svg" can just change from compat-0-2-0 to compat-0-2-3 in their Cargo.toml

Changes to the .60 language

  • PropertyAnimation: Make iteration-count: n run animations n times (b348d1)

    Side-effect: The code handles invalid inputs to duration/delay better.

    Note that this replaces the undocumented loop-countproperty that actually ran animation n + 1 times.

Fixes

  • Make sure the README of cpp still contains a branch and tag that match (ff3ef5)

    The folder was renamed in master, but not in the release tag

    Fixes #910

  • llr: Fix accessing members of ArrayIndex expressions (e4a41a)

    We were not computing the type of a ArrayIndex expression correctly: It should be the element type of array, not the array itself

  • Rust generator: Fix compilation returning from void callbacks (0dba66)

    If a callback returning voids ends in a statement that returns something, we would have an error in the rust generated code as we end our function with an expression that is not ()

  • Fix LSP semantic coloration bailing out sometimes (c5ef36)

    Step to reproduce:

    Xx := Window {
      TouchArea {
        clicked => {
          if (true) {}
          // note: because there is no else, the
          // semantic colouring is bailing out now
        }
      }
      // This is not highlighted
      TouchArea { clicked => {} } }
    

    This is caused by a bug in rowan::SyntaxToken::next_token that doesn't visit the next token if it has an empty node

    Unfortunately, the LSP has no tests, so I couldn't add one easily

  • C++ interpreter: first crash when invoking native callback (f9c3e7)

    This was a regression following the move to the edition 2021. The CallbackUserData was not capture in the lambda, its member were moved. So the destructor was called right after it was set. We must make sure we capture the whole CallbackUserData, so put the callback inside of it. This also reduce a bit of code duplication at the same time.

    Test the callback invocation with stateful lambda

OpenGL underlay example

Demos and Examples

Janitor work

  • Bump image and femtovg dependencies (378483)
  • Use document-featuresfrom crates.io (8273a3)
  • Move sixtyfps::ComponentHandle and sixtyfps::Weak into corelib::api (3eb3ff)

    This allows re-use of these types from node and the interpreter without depending on the public Rust API crate, which is a heavy dependency.

  • internal cleanup: move the public Rust Window API (3aa758)

    Move it from corelib::window::api to corelib::api, where we're going to collect more types in the future that are meant to be re-exported as public API in the sixtyfps-rs and the interpreter crate.

More janitorial changes: 5bc1e7, ba8525, e5bf6e, 0d3582, cc568a, d22c8b

Statistics

56 patches were committed by 3 authors.

← Next : 7th of February 2022 to 20th of February 2022 | Previous : 24th of January 2022 to 30th of January 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