Closed ogoffart closed 1 month ago
In order to implement this, we need to add lookup to the integer types in this trait implementation: https://github.com/slint-ui/slint/blob/b80f4552bda04fe61af287929a327c1f56906e0b/internal/compiler/lookup.rs#L917 Then add a NumberExpression similar to StringExpression in that file.
This looks useful, especially for the clamp
function!
The clamp
function, like min
/max
could support other types than float
/int
though, e.g. a duration
or length
.
Btw: I really like how things in lookup.rs
are implemented!
We should support for postfix (memeber) functions on number for math expressions:
So we could write things like